定制 atournayre/deploy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

atournayre/deploy

Composer 安装命令:

composer create-project atournayre/deploy

包简介

README 文档

README

Use Castor to deploy Symfony application.

Installation

  1. composer require atournayre/deploy
  2. cp vendor/atournayre/deploy/install/.env.dist tools/castor/.env
  3. cp vendor/atournayre/deploy/install/castor.php castor.php
  4. Run castor list to see available commands.

Features

  • Hotfix
    • deploy
    • create
    • merge

Hotfix

Deploy

Run a specific deployment script.

castor hotfix:deploy

How it works?

  1. Ask for confirmation
  2. Run pre-deploy hook
  3. Update code
  4. Run post-update-code hook
  5. Clear cache
  6. Run post-deploy hook
  7. It's done!

Events

  • hook:pre-deploy
  • hook:post-update-code (e.g. Grunt)
  • hook:post-deploy

Create

Generate a hotfix branch and optionally create a sub-branch for a specific issue.

castor hotfix:generate

Prerequisites

  • You must have a composer.json file in your working directory.
  • Your app must use semantic versioning.

How it works?

  1. Check if there are uncommitted changes in your working directory, if so, abort.
  2. Update main branch
  3. Get current version
  4. Create hotfix branch
  5. Update version
  6. Run hotfix-post-update-version hook
  7. Commit
  8. Push
  9. Ask for creation of a sub-branch in the hotfix branch
  10. Create the branch
  11. Done!

Merge

Merge the hotfix branch into main, develop and releases.

castor hotfix:merge

Update dependencies

Usage

castor dependencies:update

How it works?

  1. Check if updates are available
  2. Ask for confirmation
  3. Create the branch
  4. Update dependencies
  5. Run composer-post-update hook
  6. Commit
  7. Push
  8. It's done!

Events

  • hook:composer-post-update

Hooks

To use hooks, you must create listeners in tools/castor/events.

<?php
declare(strict_types=1);

namespace App\Tools\Castor\Events;

use Castor\Attribute\AsListener;
use Castor\Event\AfterExecuteTaskEvent;
use function Castor\context;
use function Castor\io;

#[AsListener(event: AfterExecuteTaskEvent::class)]
function afterExecutePostDeploy(AfterExecuteTaskEvent $event): void
{
    if ($event->task->getName() !== 'hook:post-deploy') {
        return;
    }

    // do something
}

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-02-02