codenamephp/deployer.crontab

1.1.1 2024-01-20 23:20 UTC

This package is auto-updated.

Last update: 2024-09-23 01:25:28 UTC


README

Packagist Version Packagist PHP Version Support Lines of code GitHub code size in bytes CI Packagist Downloads GitHub

安装

最简单的方式是通过composer。只需在命令行中运行 composer require codenamephp/deployer.crontab,它会为您安装最新版本。

用法

只需安装包并在您的deploy.php中使用任务,例如:

$deployerFunctions = new \de\codenamephp\deployer\base\functions\All();
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install()); //expects file in {{release_or_current_path}}/crontab -> crontab {{release_or_current_path}}/crontab
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install('path/to/file')); // crontab path/to/file
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Install('path/to/file', 'deployerUser')); // crontab -u deployerUser path/to/file
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Show()); // crontab -l
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Show('deployerUser')); // crontab -u deployerUser -l
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Delete()); // crontab -r
$deployerFunctions->registerTask(new \de\codenamephp\deployer\crontab\Task\Delete('deployerUser')); // crontab -u deployerUser -r

vendor/bin/dep crontab:install vendor/bin/dep crontab:show vendor/bin/dep crontab:delete