Skip to content

Commit 251cbd5

Browse files
Merge pull request #1 from codenamephp/main
Initial release
2 parents 18ca7e9 + 2797902 commit 251cbd5

11 files changed

Lines changed: 90 additions & 12 deletions

File tree

.idea/runConfigurations/All.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
4+
5+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
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

1317
Easiest 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.

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
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": {
@@ -34,10 +34,10 @@
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",

src/task/AbstractFlowTask.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace 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;
67
use de\codenamephp\deployer\command\runner\iRunner;
78
use de\codenamephp\deployer\command\runner\WithDeployerFunctions;
89
use de\codenamephp\deployer\flow\command\factory\iFlowCommandFactory;
@@ -13,7 +14,7 @@
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

src/task/Generic.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
final 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
}

src/task/cache/Flush.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
final 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
}

src/task/cache/Warmup.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@
1111
*/
1212
final 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
}

src/task/doctrine/Migrate.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@
1111
*/
1212
final 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
}

src/task/resource/Publish.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@
1111
*/
1212
final 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
}

0 commit comments

Comments
 (0)