Created
June 6, 2019 21:51
-
-
Save jimmyadaro/d4c6305e0deba26eafc0365ef5f5869c to your computer and use it in GitHub Desktop.
Deployer config base
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/common.php'; | |
// Project name | |
set('application', 'App Name'); | |
// Project repository | |
set('repository', '[email protected]:repo-name/project-name.git'); | |
// [Optional] Allocate tty for git clone. Default value is false. | |
set('git_tty', true); | |
// Writable dirs by web server | |
set('allow_anonymous_stats', false); | |
// Hosts | |
set('default_stage', 'uat'); | |
// Example for UAT environment | |
host('project-url.com') | |
->stage('uat') | |
->set('branch', 'develop') | |
->identityFile('~/.ssh/app_private_key') | |
->forwardAgent(true) | |
->multiplexing(true) | |
->set('http_user', 'the_server_user') | |
->user('the_server_user') | |
->set('deploy_path', '~/path/to/uat'); | |
// Deploy | |
task('deploy', [ | |
'deploy:info', | |
'deploy:prepare', | |
'deploy:lock', | |
'deploy:release', | |
'deploy:update_code', | |
'deploy:shared', | |
'deploy:writable', | |
'deploy:symlink', | |
'dump-assets', | |
'deploy:unlock', | |
'cleanup', | |
]); | |
// [Optional] If deploy fails automatically unlock. | |
after('deploy:failed', 'deploy:unlock'); | |
after('deploy', 'success'); | |
// Build | |
task('assets:build', function () { | |
runLocally('npm run-script build'); | |
}); | |
task('assets:upload', function () { | |
upload('assets/', '{{release_path}}/assets'); | |
}); | |
task('dump-assets', [ | |
'assets:build', | |
'assets:upload' | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment