mjaschen/deployer-tasks

1.3.0 2022-10-17 15:06 UTC

This package is auto-updated.

Last update: 2024-12-17 19:58:06 UTC


README

composer require --dev mjaschen/deployer-tasks 

Include the tasks in your deploy.php:

<?php

namespace Deployer;

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

supervisord Services

Manages (already registered) supervisord services.

Example: stopping services before deployment, starting services when updated files are in place; show service status afterwards:

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');

Configuration

Alle possible configuration options with their default values:

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

systemd Services

Manages (already registered) systemd services.

Example: stopping services before deployment, starting services when updated files are in place; show service status afterwards:

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');

Configuration

Alle possible configuration options with their default values:

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