Skip to content

Instantly share code, notes, and snippets.

@polidog polidog/deploy.php
Last active Jan 22, 2018

What would you like to do?
Deployer with symfony4
namespace Deployer;
require 'recipe/symfony3.php';
// Project name
set('application', 'sf4-todo');
// Project repository
set('repository', '');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
set('shared_files', []);
set('assets', ['public/pub', 'public/images', 'public/js']);
// Hosts
host('your server')
->set('symfony_env', 'prod')
->set('composer_options', 'install --verbose --prefer-dist --optimize-autoloader --no-progress --no-interaction --no-scripts')
->set('deploy_path', '/var/www/sf4-todo');
// Tasks
task('build', function () {
run('cd {{release_path}} && build');
task('deploy:assets:install', function () {
run('{{bin/php}} {{bin/console}} assets:install {{console_options}} {{release_path}}/public');
})->desc('Install bundle assets');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Migrate database before symlink new release.
before('deploy:symlink', 'database:migrate');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.