Skip to content

Instantly share code, notes, and snippets.

@exts
Last active Jan 3, 2018
Embed
What would you like to do?
Deployer 6.0 - Symfony Flex (4.0) Basic Deploy script
<?php
namespace Deployer;
require 'recipe/common.php';
//Project Name
set('application', 'app_name');
// Project repository
set('repository', 'git@bitbucket.org:USER/REPO.git');
// [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', [
'.env',
]);
set('shared_dirs', [
'var/log'
]);
// Writable dirs by web server
set('writable_dirs', []);
set('allow_anonymous_stats', false);
// Hosts
host('website.net')
->set('deploy_path', '/var/www/website.net');
// 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', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'symlink:public',
'cleanup',
'success'
]);
// [Optional] If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
@exts

This comment has been minimized.

Copy link
Owner Author

@exts 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