Created
July 4, 2019 11:40
-
-
Save ardziej/5018f2ed3106c3fe87617d1e668e20ef to your computer and use it in GitHub Desktop.
This file contains 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/laravel.php'; | |
//require 'deployer/recipes/recipe/slack.php'; | |
//require 'recipe/slack.php'; | |
//require 'vendor/deployer/recipes/recipe/slack.php'; | |
// Configuration | |
set('repository', 'git@bitbucket.org:repo/name.git'); | |
set('keep_releases', 5); | |
set('default_stage', 'production'); | |
set('composer_options', 'install --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader'); | |
task('artisan:cache:clear:env', function () { | |
run("cd {{release_path}} && php artisan config:cache"); | |
run("cd {{release_path}} && php artisan config:clear"); | |
})->desc('Clear cache env'); | |
task('artisan permission:cache-reset', function () { | |
run("cd {{release_path}} && php artisan permission:cache-reset"); | |
})->desc('Clear permissions cache'); | |
host('host') | |
->stage('production') | |
->set('branch', 'develop') | |
->user('user') | |
->port(22) | |
->configFile('~/.ssh/config') | |
->identityFile('~/.ssh/key') | |
->addSshOption('UserKnownHostsFile', '~/.ssh/known_hosts') | |
->addSshOption('StrictHostKeyChecking', 'no') | |
->set('deploy_path', '/var/www/name'); | |
before('deploy:symlink', 'deploy:public_disk'); | |
task('deploy', [ | |
'deploy:info', | |
'deploy:prepare', | |
'deploy:lock', | |
'deploy:release', | |
'deploy:update_code', | |
'deploy:shared', | |
'deploy:vendors', | |
'deploy:writable', | |
'artisan:migrate', | |
'artisan:storage:link', | |
'artisan:queue:restart', | |
'artisan:view:clear', | |
'artisan:cache:clear', | |
'artisan:config:cache', | |
'artisan:cache:clear:env', | |
'artisan permission:cache-reset', | |
'artisan:queue:restart', | |
'artisan:optimize', | |
'deploy:symlink', | |
'deploy:unlock', | |
'cleanup', | |
]); | |
//php artisan queue:restart | |
//before('deploy', 'slack:notify'); | |
//after('success', 'slack:notify:success'); | |
//after('deploy', 'slack:notify'); | |
//after('deploy', 'deploy:slack'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment