2018-09-20 11:20:57 +02:00
|
|
|
task :deploy do
|
2018-10-24 10:20:19 +02:00
|
|
|
domains = case ENV['STAGE']
|
2018-10-23 18:26:23 +02:00
|
|
|
when 'dev'
|
|
|
|
['web1.dev', 'web2.dev']
|
|
|
|
when 'master'
|
|
|
|
['web1', 'web2']
|
|
|
|
else
|
2018-10-24 10:20:19 +02:00
|
|
|
raise "STAGE #{STAGE} is unknown. It must be either dev or master"
|
2018-10-19 11:09:57 +02:00
|
|
|
end
|
|
|
|
|
2018-10-24 10:22:41 +02:00
|
|
|
branch = ENV['BRANCH'] || 'dev'
|
2018-10-19 11:09:57 +02:00
|
|
|
|
2018-09-20 11:20:23 +02:00
|
|
|
domains.each do |domain|
|
2018-10-19 11:09:57 +02:00
|
|
|
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"
|
2018-09-03 18:36:09 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task :setup do
|
|
|
|
domains = ['web1', 'web2']
|
|
|
|
domains.each do |domain|
|
|
|
|
sh "mina setup domain=#{domain} force_asset_precompile=true"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task :setup_dev do
|
|
|
|
domains = ['web1.dev', 'web2.dev']
|
|
|
|
domains.each do |domain|
|
|
|
|
sh "mina setup domain=#{domain} force_asset_precompile=true"
|
2018-09-20 11:20:23 +02:00
|
|
|
end
|
|
|
|
end
|