Skip to content

Commit 7a71c1e

Browse files
Merge pull request #14 from codenamephp/updatedReadme
Updated readme
2 parents da02de1 + ea83c5d commit 7a71c1e

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ on:
44
merge_group:
55
push:
66
branches:
7-
- main
87
- release
98
paths-ignore:
109
- '**.md'
1110
pull_request:
1211
branches:
13-
- main
1412
- release
1513
paths-ignore:
1614
- '**.md'

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,21 @@
1212

1313
Easiest way is via composer. Just run `composer require codenamephp/deployer.crontab` in your cli which should install the latest version for you.
1414

15-
## Usage
15+
## Usage
16+
17+
Just install the package and use the task in your deploy.php, e.g:
18+
19+
```php
20+
21+
$deployerFunctions = new \de\codenamephp\deployer\base\functions\All();
22+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install()); //expects file in {{release_or_current_path}}/crontab -> crontab {{release_or_current_path}}/crontab
23+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install('path/to/file')); // crontab path/to/file
24+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install('path/to/file', 'deployerUser')); // crontab -u deployerUser path/to/file
25+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Show()); // crontab -l
26+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Show('deployerUser')); // crontab -u deployerUser -l
27+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Delete()); // crontab -r
28+
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Delete('deployerUser')); // crontab -u deployerUser -r
29+
```
30+
`vendor/bin/dep crontab:install`
31+
`vendor/bin/dep crontab:show`
32+
`vendor/bin/dep crontab:delete`

0 commit comments

Comments
 (0)