Last active
June 5, 2023 05:01
-
-
Save mabasic/a43b7ac80ee08c04f594 to your computer and use it in GitHub Desktop.
Envoy common features with Slack notifications. See http://laravel.com/docs/5.0/envoy for more info.
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
@servers(['web' => '[email protected] -p 1234']) | |
@setup | |
$project_name = 'Project Name'; | |
$project_url = 'http://project-domain.com/'; | |
$project_root = '/www/project/web'; | |
$slack_hook = 'your-slack-hook-url'; | |
$slack_channel = '#channel'; | |
@endsetup | |
@task('put_app_up', ['on' => 'web']) | |
cd {{ $project_root }} | |
php artisan up | |
@endtask | |
@task('put_app_down', ['on' => 'web']) | |
cd {{ $project_root }} | |
php artisan down | |
@endtask | |
@task('pull_latest_changes', ['on' => 'web']) | |
cd {{ $project_root }} | |
git pull origin | |
@endtask | |
@task('install_dependencies', ['on' => 'web']) | |
cd {{ $project_root }} | |
composer install --prefer-source --no-interaction --no-dev | |
@endtask | |
@task('clear_cache', ['on' => 'web']) | |
cd {{ $project_root }} | |
php artisan cache:clear | |
@endtask | |
@macro('update') | |
put_app_down | |
pull_latest_changes | |
install_dependencies | |
put_app_up | |
@endmacro | |
@after | |
@slack($slack_hook, $slack_channel, "Envoy task $task ran on <$project_url|[$project_name]>") | |
@endafter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@finished worked for us