Remove host references from public sources
This commit is contained in:
parent
93fb04cc36
commit
15d967439e
1 changed files with 8 additions and 11 deletions
|
@ -1,16 +1,13 @@
|
||||||
def domains_for_stage(stage)
|
def domains_for_stage
|
||||||
case stage
|
if ENV['DOMAINS'].present?
|
||||||
when 'dev'
|
ENV['DOMAINS'].split
|
||||||
['web1.dev', 'web2.dev']
|
|
||||||
when 'prod'
|
|
||||||
['web1', 'web2', 'web3', 'web4']
|
|
||||||
else
|
else
|
||||||
raise "STAGE #{stage} is unknown. It must be either dev or prod."
|
raise "DOMAINS is empty. It must be something like DOMAINS='web1.dev web2.dev'"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :setup do
|
task :setup do
|
||||||
domains = domains_for_stage(ENV.fetch('STAGE'))
|
domains = domains_for_stage
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
sh "mina setup domain=#{domain}"
|
sh "mina setup domain=#{domain}"
|
||||||
|
@ -18,7 +15,7 @@ task :setup do
|
||||||
end
|
end
|
||||||
|
|
||||||
task :deploy do
|
task :deploy do
|
||||||
domains = domains_for_stage(ENV.fetch('STAGE'))
|
domains = domains_for_stage
|
||||||
branch = ENV.fetch('BRANCH')
|
branch = ENV.fetch('BRANCH')
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
|
@ -27,14 +24,14 @@ task :deploy do
|
||||||
end
|
end
|
||||||
|
|
||||||
task :post_deploy do
|
task :post_deploy do
|
||||||
domains = domains_for_stage(ENV.fetch('STAGE'))
|
domains = domains_for_stage
|
||||||
branch = ENV.fetch('BRANCH')
|
branch = ENV.fetch('BRANCH')
|
||||||
|
|
||||||
sh "mina post_deploy domain=#{domains.first} branch=#{branch}"
|
sh "mina post_deploy domain=#{domains.first} branch=#{branch}"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :rollback do
|
task :rollback do
|
||||||
domains = domains_for_stage(ENV.fetch('STAGE'))
|
domains = domains_for_stage
|
||||||
branch = ENV.fetch('BRANCH')
|
branch = ENV.fetch('BRANCH')
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
|
|
Loading…
Reference in a new issue