friemt/deployer-tasks

Deployer 原包中不提供的额外和增强任务。

1.3.0 2024-09-18 21:36 UTC

This package is auto-updated.

Last update: 2024-09-27 07:29:58 UTC


README

Deployer 原包中不提供的额外和增强任务。Deployer

安装

composer require friemt/deployer-tasks

使用方法

将配方或任务及其相应配置包含到您的deployer文件中。

crontab

同步配置的cron任务到目标系统。

# deploy.php
# ...

import('recipe/crontab.php');
# or
import('task/crontab.php');

# See `src/examples/crontab.yaml` for a yaml based example file.
import(__DIR__ . '/<path-to-configs>/crontab.yaml');

# When using the task instead of the recipe, add the sync task to the deployment manually:
after('deploy:symlink', 'crontab:sync');

变量

任务

runonce

在目标系统上运行一次定义的命令,且仅运行一次。

# deploy.php
# ...

import('recipe/runonce.php');
# or
import('task/runonce.php');

# See `src/examples/runonce.yaml` for a yaml based example file.
import(__DIR__ . '/<path-to-configs>/runonce.yaml');

# When using the task instead of the recipe, add the run task to the deployment manually:
after('deploy:symlink', 'runonce:run');

变量

任务

模板

替换deployer占位符后,将文件复制到目标系统。

# deploy.php
# ...

import('recipe/template.php');
# or
import('task/template.php');

# See `src/examples/template.yaml` for a yaml based example file.
import(__DIR__ . '/<path-to-configs>/template.yaml');

# When using the task instead of the recipe, add the sync task to the deployment manually:
after('deploy:symlink', 'template:sync');

变量

任务

清理

从旧版本中删除过时的文件和文件夹。

# deploy.php
# ...

import('recipe/cleanup.php');
# or
import('task/cleanup.php');

# When using the task instead of the recipe, add the run task to the deployment manually:
after('deploy', 'cleanup:paths');

变量

任务

符号链接

从给定列表中创建主机的任何位置的符号链接。

# deploy.php
# ...

import('recipe/symlink.php');
# or
import('task/symlink.php');

# When using the task instead of the recipe, add the run task to the deployment manually:
before('deploy:shared', 'symlink:create');

变量

任务

supervisor

supervisor的任务停止和启动,以避免部署期间的运行时错误。

# deploy.php
# ...

import('recipe/supervisor.php');
# or
import('task/supervisor.php');

# When using the task instead of the recipe, add the run task to the deployment manually:
before('deploy:publish', 'supervisor:stop');
after('deploy:publish', 'supervisor:start');

变量

任务