domains_from_env → domains_for_stage

This commit is contained in:
gregoirenovel 2018-10-24 16:00:07 +02:00
parent 000d19b1f6
commit 916dd17873

View file

@ -1,16 +1,16 @@
def domains_from_env(env) def domains_for_stage(stage)
case env case stage
when 'dev' when 'dev'
['web1.dev', 'web2.dev'] ['web1.dev', 'web2.dev']
when 'prod' when 'prod'
['web1', 'web2'] ['web1', 'web2']
else else
raise "STAGE #{env} is unknown. It must be either dev or prod" raise "STAGE #{stage} is unknown. It must be either dev or prod."
end end
end end
task :deploy do task :deploy do
domains = domains_from_env(ENV.fetch('STAGE')) domains = domains_for_stage(ENV.fetch('STAGE'))
branch = ENV.fetch('BRANCH') branch = ENV.fetch('BRANCH')
domains.each do |domain| domains.each do |domain|
@ -19,7 +19,7 @@ task :deploy do
end end
task :setup do task :setup do
domains = domains_from_env(ENV['STAGE']) domains = domains_for_stage(ENV.fetch('STAGE'))
domains.each do |domain| domains.each do |domain|
sh "mina setup domain=#{domain} force_asset_precompile=true" sh "mina setup domain=#{domain} force_asset_precompile=true"