Last active
January 22, 2018 09:52
-
-
Save polidog/3f0fcfbbbd9f09ffda03c842559697a1 to your computer and use it in GitHub Desktop.
Deployer with symfony4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Deployer; | |
require 'recipe/symfony3.php'; | |
// Project name | |
set('application', 'sf4-todo'); | |
// Project repository | |
set('repository', '[email protected]:polidog/sf4-todo.git'); | |
// [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') | |
->stage('dev') | |
->user("deploy") | |
->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