Deploy: use fetch

This commit is contained in:
simon lehericey 2018-10-24 11:40:08 +02:00
parent e63ba1b9cb
commit a1d813aff4
2 changed files with 5 additions and 10 deletions

View file

@ -13,20 +13,15 @@ require 'mina/rbenv'
# forward_agent - SSH forward_agent
# user - Username in the server to SSH to
if ENV['domain'].nil?
raise "missing `domain`"
end
set :domain, ENV['domain']
set :domain, ENV.fetch('domain')
set :repository, 'https://github.com/betagouv/tps.git'
deploy_to = '/var/www/ds'
set :deploy_to, deploy_to
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.
# They will be linked in the 'deploy:link_shared_paths' step.

View file

@ -10,8 +10,8 @@ def domains_from_env(env)
end
task :deploy do
domains = domains_from_env(ENV['STAGE'])
branch = ENV['BRANCH'] || 'dev'
domains = domains_from_env(ENV.fetch('STAGE'))
branch = ENV.fetch('BRANCH')
domains.each do |domain|
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"