File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+
4+
5+ \* * This Changelog was automatically generated by [ github_changelog_generator] ( https://github.com/github-changelog-generator/github-changelog-generator ) *
Original file line number Diff line number Diff line change 88![ Packagist Downloads] ( https://img.shields.io/packagist/dt/codenamephp/deployer.flow )
99![ GitHub] ( https://img.shields.io/github/license/codenamephp/deployer.flow )
1010
11+ ## What is it?
12+
13+ This package provides deployer task for the flow framework.
14+
1115## Installation
1216
1317Easiest way is via composer. Just run ` composer require codenamephp/deployer.flow ` in your cli which should install the latest version for you.
1418
15- ## Usage
19+ ## Usage
20+
21+ First you need to add the ` flow:context ` configuration to each host according to your context names.
22+
23+ Then just use the provided tasks in your deployer file or extend the ` \de\codenamephp\deployer\flow\task\AbstractFlowTask ` and use the
24+ ` \de\codenamephp\deployer\flow\command\factory\iFlowCommandFactory ` to run commands.
Original file line number Diff line number Diff line change 1313 "prefer-stable" : true ,
1414 "require" : {
1515 "php" : " ^8.1" ,
16- "codenamephp/deployer.base" : " dev-main " ,
17- "codenamephp/deployer.command" : " dev-main "
16+ "codenamephp/deployer.base" : " ^1.0 " ,
17+ "codenamephp/deployer.command" : " ^1.0 "
1818 },
1919 "autoload" : {
2020 "psr-4" : {
3434 "sort-packages" : true
3535 },
3636 "scripts" : {
37- "phpunit" : " tools/phpunit.phar -c test/phpunit.dist.xml test/" ,
38- "psalm" : " tools/psalm --threads=10 --long-progress" ,
39- "composer-unused" : " tools/composer-unused --no-progress --no-interaction --profile" ,
40- "composer-require-checker" : " tools/composer-require-checker --no-interaction" ,
37+ "phpunit" : " XDEBUG_MODE=coverage tools/phpunit.phar -c test/phpunit.dist.xml test/" ,
38+ "psalm" : " XDEBUG_MODE=off tools/psalm --threads=10 --long-progress" ,
39+ "composer-unused" : " XDEBUG_MODE=off tools/composer-unused --no-progress --no-interaction --profile" ,
40+ "composer-require-checker" : " XDEBUG_MODE=off tools/composer-require-checker --no-interaction" ,
4141 "infection" : " XDEBUG_MODE=coverage tools/infection --min-msi=100 --min-covered-msi=100 --threads=4 --no-progress --show-mutations" ,
4242 "ci-all" : [
4343 " @phpunit" ,
Original file line number Diff line number Diff line change 22
33namespace de \codenamephp \deployer \flow \task ;
44
5- use de \codenamephp \deployer \base \task \iTask ;
5+ use de \codenamephp \deployer \base \task \iTaskWithDescription ;
6+ use de \codenamephp \deployer \base \task \iTaskWithName ;
67use de \codenamephp \deployer \command \runner \iRunner ;
78use de \codenamephp \deployer \command \runner \WithDeployerFunctions ;
89use de \codenamephp \deployer \flow \command \factory \iFlowCommandFactory ;
1314 *
1415 * The flow command is created with the command factory using the command and arguments and run using the command runner
1516 */
16- abstract class AbstractFlowTask implements iTask {
17+ abstract class AbstractFlowTask implements iTaskWithName, iTaskWithDescription {
1718
1819 public function __construct (public iFlowCommandFactory $ commandFactory = new WithBinaryFromDeployer (), public iRunner $ commandRunner = new WithDeployerFunctions ()) { }
1920
Original file line number Diff line number Diff line change 1414final class Generic extends AbstractFlowTask {
1515
1616 public function __construct (public string $ command ,
17+ public string $ taskName ,
1718 /** @var array<int,string> */
1819 public array $ arguments = [],
20+ public string $ taskDescription = '' ,
1921 iFlowCommandFactory $ commandFactory = new WithBinaryFromDeployer (),
2022 iRunner $ commandRunner = new WithDeployerFunctions ()) {
2123 parent ::__construct ($ commandFactory , $ commandRunner );
@@ -28,4 +30,12 @@ public function getCommand() : string {
2830 public function getArguments () : array {
2931 return $ this ->arguments ;
3032 }
33+
34+ public function getDescription () : string {
35+ return $ this ->taskDescription ;
36+ }
37+
38+ public function getName () : string {
39+ return $ this ->taskName ;
40+ }
3141}
Original file line number Diff line number Diff line change 1515 */
1616final class Flush extends AbstractFlowTask {
1717
18+ public const NAME = 'flow:cache:flush ' ;
19+
1820 public function __construct (public bool $ force = false ,
1921 iFlowCommandFactory $ commandFactory = new WithBinaryFromDeployer (),
2022 iRunner $ commandRunner = new WithDeployerFunctions ()) {
@@ -28,4 +30,12 @@ public function getCommand() : string {
2830 public function getArguments () : array {
2931 return $ this ->force ? ['--force ' ] : [];
3032 }
33+
34+ public function getDescription () : string {
35+ return 'Flushes all configured caches. ' ;
36+ }
37+
38+ public function getName () : string {
39+ return self ::NAME ;
40+ }
3141}
Original file line number Diff line number Diff line change 1111 */
1212final class Warmup extends AbstractFlowTask {
1313
14+ public const NAME = 'flow:cache:warmup ' ;
15+
1416 public function getCommand () : string {
1517 return 'cache:warmup ' ;
1618 }
1719
1820 public function getArguments () : array {
1921 return [];
2022 }
23+
24+ public function getDescription () : string {
25+ return 'Fills caches for the next request. ' ;
26+ }
27+
28+ public function getName () : string {
29+ return self ::NAME ;
30+ }
2131}
Original file line number Diff line number Diff line change 1111 */
1212final class Migrate extends AbstractFlowTask {
1313
14+ public const NAME = 'flow:doctrine:migrate ' ;
15+
1416 public function getCommand () : string {
1517 return 'doctrine:migrate ' ;
1618 }
1719
1820 public function getArguments () : array {
1921 return [];
2022 }
23+
24+ public function getDescription () : string {
25+ return 'Runs the doctrine database migrations ' ;
26+ }
27+
28+ public function getName () : string {
29+ return self ::NAME ;
30+ }
2131}
Original file line number Diff line number Diff line change 1111 */
1212final class Publish extends AbstractFlowTask {
1313
14+ public const NAME = 'flow:resource:publish ' ;
15+
1416 public function getCommand () : string {
1517 return 'resource:publish ' ;
1618 }
1719
1820 public function getArguments () : array {
1921 return [];
2022 }
23+
24+ public function getDescription () : string {
25+ return 'Publish the resources to the public directory. ' ;
26+ }
27+
28+ public function getName () : string {
29+ return self ::NAME ;
30+ }
2131}
You can’t perform that action at this time.
0 commit comments