atournayre / deploy
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.2.22
- symfony/console: ^6.4
This package is auto-updated.
Last update: 2025-02-04 23:43:42 UTC
README
Use Castor to deploy Symfony application.
Installation
composer require atournayre/deploy
cp vendor/atournayre/deploy/install/.env.dist tools/castor/.env
cp vendor/atournayre/deploy/install/castor.php castor.php
- 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?
- Ask for confirmation
- Run pre-deploy hook
- Update code
- Run post-update-code hook
- Clear cache
- Run post-deploy hook
- 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?
- Check if there are uncommitted changes in your working directory, if so, abort.
- Update main branch
- Get current version
- Create hotfix branch
- Update version
- Run hotfix-post-update-version hook
- Commit
- Push
- Ask for creation of a sub-branch in the hotfix branch
- Create the branch
- Done!
Merge
Merge the hotfix branch into main, develop and releases.
castor hotfix:merge
Update dependencies
Usage
castor dependencies:update
How it works?
- Check if updates are available
- Ask for confirmation
- Create the branch
- Update dependencies
- Run composer-post-update hook
- Commit
- Push
- 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 }