Skip to content

Instantly share code, notes, and snippets.

@Artistan
Forked from halilim/Envoy.blade.php
Created August 15, 2017 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Artistan/70022f03f338859dcc855845b7a14fc2 to your computer and use it in GitHub Desktop.
Save Artistan/70022f03f338859dcc855845b7a14fc2 to your computer and use it in GitHub Desktop.
Sample Envoy tasks for a Laravel project. - http://laravel.com/docs/ssh - https://github.com/laravel/envoy
* -A in SSH enables agent forwarding.
* -p 2122 is not needed if you use the default port of 22.
* Replace SSH_USER and example.com with your own values.
* Example run: $ envoy run deploy_demo
* --no-scripts because Laravel composer.json's post-install-cmd includes optimize, which is already done by php artisan dump-autoload
@servers(['test' => '-A -p 2122 -l user test.example.com', 'prod' => '-A -p 2122 -l user example.com'])
@task('install_test', ['on' => ['test']])
cd project
git clone git@bitbucket.org:example/example.com.git .
composer install -n --no-dev --no-scripts
php artisan dump-autoload
php artisan migrate
chmod -R 0777 public/upload app/storage
@endtask
@task('install_prod', ['on' => ['prod']])
cd project
git clone git@bitbucket.org:example/example.com.git .
composer install -n --no-dev --no-scripts
php artisan dump-autoload
php artisan migrate
chmod -R 0777 public/upload app/storage
@endtask
@task('deploy_test', ['on' => ['test']])
cd project
git pull origin
composer install -n --no-dev --no-scripts
php artisan dump-autoload
php artisan migrate
@endtask
@task('deploy_prod', ['on' => ['prod']])
cd project
git pull origin
composer install -n --no-dev --no-scripts
php artisan dump-autoload
php artisan migrate
@endtask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment