From 55525af0603e6c78a0e4f105a7084e7462c7844f Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 4 Dec 2018 14:42:52 +0100 Subject: [PATCH] Add rake task to run after party with mina --- config/deploy.rb | 11 +++++++++-- lib/tasks/deploy.rake | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 09d6c0ff0..feaa497c9 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -57,7 +57,7 @@ namespace :after_party do desc "Run after_party tasks." task :run do command %{ - echo "-----> Running deploy tasks" + echo "-----> Running after_party" #{echo_cmd %[bundle exec rake after_party:run]} } end @@ -103,7 +103,6 @@ task :deploy do invoke :'bundle:install' invoke :'yarn:install' invoke :'rails:db_migrate' - # invoke :'after_party:run' invoke :'rails:assets_precompile' on :launch do @@ -114,3 +113,11 @@ task :deploy do end end end + +task :post_deploy do + command 'export PATH=$PATH:/home/ds/.rbenv/bin:/home/ds/.rbenv/shims' + command 'source /home/ds/.profile' + command 'cd /home/ds/current' + + invoke :'after_party:run' +end diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake index 2bcc57a37..c40699bfd 100644 --- a/lib/tasks/deploy.rake +++ b/lib/tasks/deploy.rake @@ -25,3 +25,10 @@ task :deploy do sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true" end end + +task :post_deploy do + domains = domains_for_stage(ENV.fetch('STAGE')) + branch = ENV.fetch('BRANCH') + + sh "mina post_deploy domain=#{domains.first} branch=#{branch}" +end