mjaschen/deployer-tasks

1.3.0 2022-10-17 15:06 UTC

This package is auto-updated.

Last update: 2024-09-17 19:23:02 UTC


README

composer require --dev mjaschen/deployer-tasks 

将任务包含在您的 deploy.php

<?php

namespace Deployer;

require 'recipe/common.php';
require 'systemd-service.php';
require 'supervisord-service.php';

supervisord 服务

管理(已注册的)supervisord 服务。

示例:在部署前停止服务,当更新文件到位时启动服务;之后显示服务状态

set('supervisord_service_names', ['acme_worker']);

// (optional) when supervisor command is not in $PATH:
set('supervisorctl_command', '/opt/supervisor/supervisorctl');

before('deploy:prepare', 'supervisord-service:stop')
after('deploy:symlink', 'supervisord-service:start')
after('supervisord-service:start', function() {
    sleep(1);
});
after('supervisord-service:start', 'supervisord-service:status');

配置

所有可能的配置选项及其默认值

set('supervisord_service_names', []);
set('supervisorctl_use_sudo', true);
set('supervisorctl_command', 'supervisorctl');

systemd 服务

管理(已注册的)systemd 服务。

示例:在部署前停止服务,当更新文件到位时启动服务;之后显示服务状态

set('systemd_service_names', ['acme_worker.service']);

before('deploy:prepare', 'systemd-service:stop')
after('deploy:symlink', 'systemd-service:start')
after('systemd-service:start', function() {
    sleep(1);
});
after('systemd-service:start', 'systemd-service:status');

配置

所有可能的配置选项及其默认值

set('systemd_service_names', []);
set('systemd_systemctl_use_sudo', true);
set('systemd_systemctl_command', 'systemctl');