Skip to content

Instantly share code, notes, and snippets.

Last active January 3, 2018 17:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Deployer 6.0 - Symfony Flex (4.0) Basic Deploy script
namespace Deployer;
require 'recipe/common.php';
//Project Name
set('application', 'app_name');
// Project repository
set('repository', '');
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
//composer options
set('composer_action', 'update');
set('composer_options', '{{composer_action}} --optimize-autoloader --no-suggest --no-progress');
// Shared files/dirs between deploys
set('shared_files', [
set('shared_dirs', [
// Writable dirs by web server
set('writable_dirs', []);
set('allow_anonymous_stats', false);
// Hosts
->set('deploy_path', '/var/www/');
// Tasks
task('symlink:public', function() {
$output = run('if [ ! -d {{deploy_path}}/www ]; then ln -s {{deploy_path}}/current/public {{deploy_path}}/www; fi;');
task('doctrine:update', function() {
$output = run('if [ -f {{deploy_path}}/current/bin/console ]; then php {{deploy_path}}/current/bin/console doctrine:schema:update --force; fi');
writeln('<info>' . $output . '</info>');
desc('Deploy project');
task('deploy', [
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
Copy link

exts commented Jan 3, 2018

Nothing special, but if you want to get a basic app up you can use this as a base. Since almost all your configuration is in the .env file you can share just that file and maybe the logs folder and you're good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment