Merge pull request #3120 from betagouv/after_party_task

Add rake task to run after party with mina
This commit is contained in:
Pierre de La Morinerie 2018-12-04 14:46:16 +01:00 committed by GitHub
commit 8ae0b32f76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -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

View file

@ -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