diff --git a/deploy.php b/deploy.php new file mode 100644 index 0000000..fc43469 --- /dev/null +++ b/deploy.php @@ -0,0 +1,50 @@ +stage('production') + ->user('yvan') + ->forwardAgent() + ->set('php_service_name', 'php7.1-fpm') + ->set('deploy_path', '/mnt/apps/skies-proxy-api'); + +desc('Restart PHP-FPM service'); +task('php-fpm:restart', function () { + // The user must have rights for restart service + // /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service + run('sudo service {{php_service_name}} reload'); +}); +after('deploy:symlink', 'php-fpm:restart'); + +task('deploy', [ + 'deploy:prepare', + 'deploy:lock', + 'deploy:release', + 'deploy:update_code', + 'deploy:shared', + 'deploy:writable', + 'deploy:vendors', + 'deploy:clear_paths', + 'deploy:symlink', + 'deploy:unlock', + 'cleanup', +]); + +after('deploy', 'success');