Deploy: use fetch
This commit is contained in:
parent
e63ba1b9cb
commit
a1d813aff4
2 changed files with 5 additions and 10 deletions
|
@ -13,20 +13,15 @@ require 'mina/rbenv'
|
||||||
# forward_agent - SSH forward_agent
|
# forward_agent - SSH forward_agent
|
||||||
# user - Username in the server to SSH to
|
# user - Username in the server to SSH to
|
||||||
|
|
||||||
|
set :domain, ENV.fetch('domain')
|
||||||
if ENV['domain'].nil?
|
|
||||||
raise "missing `domain`"
|
|
||||||
end
|
|
||||||
|
|
||||||
set :domain, ENV['domain']
|
|
||||||
|
|
||||||
set :repository, 'https://github.com/betagouv/tps.git'
|
set :repository, 'https://github.com/betagouv/tps.git'
|
||||||
deploy_to = '/var/www/ds'
|
deploy_to = '/var/www/ds'
|
||||||
set :deploy_to, deploy_to
|
set :deploy_to, deploy_to
|
||||||
set :user, 'ds'
|
set :user, 'ds'
|
||||||
set :branch, ENV['branch']
|
|
||||||
|
|
||||||
print "Deploy to #{ENV['domain']}, branch : #{ENV['branch']}\n"
|
print "Deploy to #{ENV.fetch('domain')}, branch : #{ENV.fetch('branch')}\n"
|
||||||
|
set :branch, ENV.fetch('branch')
|
||||||
|
|
||||||
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
# 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.
|
# They will be linked in the 'deploy:link_shared_paths' step.
|
||||||
|
|
|
@ -10,8 +10,8 @@ def domains_from_env(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
task :deploy do
|
task :deploy do
|
||||||
domains = domains_from_env(ENV['STAGE'])
|
domains = domains_from_env(ENV.fetch('STAGE'))
|
||||||
branch = ENV['BRANCH'] || 'dev'
|
branch = ENV.fetch('BRANCH')
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"
|
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue