When deploying read stage from environment
This commit is contained in:
parent
e41a597386
commit
8316ab8e51
2 changed files with 12 additions and 12 deletions
|
@ -23,10 +23,9 @@ set :repository, 'https://github.com/betagouv/tps.git'
|
|||
deploy_to = '/var/www/ds'
|
||||
set :deploy_to, deploy_to
|
||||
set :user, 'ds'
|
||||
branch = 'puma'
|
||||
set :branch, branch
|
||||
set :branch, ENV['branch']
|
||||
|
||||
print "Deploy to #{ENV['domain']}, branch : #{branch}\n"
|
||||
print "Deploy to #{ENV['domain']}, branch : #{ENV['branch']}\n"
|
||||
|
||||
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
||||
# They will be linked in the 'deploy:link_shared_paths' step.
|
||||
|
@ -103,6 +102,7 @@ task :deploy do
|
|||
# Put things that will set up an empty directory into a fully set-up
|
||||
# instance of your project.
|
||||
invoke :'git:clone'
|
||||
|
||||
invoke :'deploy:link_shared_paths'
|
||||
invoke :'bundle:install'
|
||||
invoke :'yarn:install'
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
task :deploy do
|
||||
if ENV['STAGE_NAME'] == 'dev'
|
||||
domains = ['web1.dev', 'web2.dev']
|
||||
elsif ENV['STAGE_NAME'] == 'master'
|
||||
domains = ['web1', 'web2']
|
||||
end
|
||||
|
||||
branch = ENV['STAGE_NAME']
|
||||
|
||||
domains.each do |domain|
|
||||
sh "mina deploy domain=#{domain} force_asset_precompile=true"
|
||||
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -12,13 +19,6 @@ task :setup do
|
|||
end
|
||||
end
|
||||
|
||||
task :deploy_dev do
|
||||
domains = ['web1.dev', 'web2.dev']
|
||||
domains.each do |domain|
|
||||
sh "mina deploy domain=#{domain} force_asset_precompile=true"
|
||||
end
|
||||
end
|
||||
|
||||
task :setup_dev do
|
||||
domains = ['web1.dev', 'web2.dev']
|
||||
domains.each do |domain|
|
||||
|
|
Loading…
Reference in a new issue