Add the new TPS instance OpenSimplif on deploy task

This commit is contained in:
Xavier J 2016-10-10 18:21:46 +02:00
parent 627d80277b
commit 02000eeb41

View file

@ -11,11 +11,10 @@ require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# branch - Branch name to deploy. (needed by mina/git) # branch - Branch name to deploy. (needed by mina/git)
ENV['to'] ||= "staging" ENV['to'] ||= "staging"
ENV['to'] = "staging" unless ["staging", "production"].include?(ENV['to']) ENV['to'] = "staging" unless ["staging", "production", "opensimplif"].include?(ENV['to'])
raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil? raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil?
print "Deploy to #{ENV['to']} environment branch #{branch}\n" print "Deploy to #{ENV['to']} environment branch #{branch}\n"
# set :domain, '5.135.190.60' # set :domain, '5.135.190.60'
@ -25,7 +24,6 @@ set :port, 2200
set :deploy_to, '/var/www/tps_dev' set :deploy_to, '/var/www/tps_dev'
if ENV["to"] == "staging" if ENV["to"] == "staging"
if ENV['branch'].nil? if ENV['branch'].nil?
set :branch, 'staging' set :branch, 'staging'
@ -44,10 +42,24 @@ elsif ENV["to"] == "production"
set :deploy_to, '/var/www/tps' set :deploy_to, '/var/www/tps'
set :user, 'tps' # Username in the server to SSH to. set :user, 'tps' # Username in the server to SSH to.
appname = 'tps' appname = 'tps'
elsif ENV["to"] == "opensimplif"
if ENV['branch'].nil?
set :branch, 'master'
else
set :branch, ENV['branch']
end
set :deploy_to, '/var/www/opensimplif'
set :user, 'opensimplif' # Username in the server to SSH to.
appname = 'opensimplif'
end end
set :rails_env, ENV["to"] set :rails_env, ENV["to"]
if ENV["to"] == "opensimplif"
set :rails_env, "production"
end
# For system-wide RVM install. # For system-wide RVM install.
# set :rvm_path, '/usr/local/rvm/bin/rvm' # set :rvm_path, '/usr/local/rvm/bin/rvm'
@ -66,7 +78,7 @@ set :shared_paths, [
"config/fog_credentials.yml", "config/fog_credentials.yml",
'config/initializers/secret_token.rb', 'config/initializers/secret_token.rb',
'config/initializers/features.yml', 'config/initializers/features.yml',
"config/environments/#{ENV['to']}.rb", "config/environments/#{rails_env}.rb",
"config/initializers/token.rb", "config/initializers/token.rb",
"config/initializers/urls.rb", "config/initializers/urls.rb",
"config/initializers/super_admin.rb", "config/initializers/super_admin.rb",
@ -74,7 +86,8 @@ set :shared_paths, [
"config/initializers/raven.rb", "config/initializers/raven.rb",
'config/france_connect.yml', 'config/france_connect.yml',
'config/initializers/mailjet.rb', 'config/initializers/mailjet.rb',
'config/initializers/storage_url.rb' 'config/initializers/storage_url.rb',
'app/views/root/landing.html.haml'
] ]
@ -112,6 +125,9 @@ task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/config"] queue! %[mkdir -p "#{deploy_to}/shared/config"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"] queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]
queue! %[mkdir -p "#{deploy_to}/shared/app"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"]
queue! %[touch "#{deploy_to}/shared/config/database.yml"] queue! %[touch "#{deploy_to}/shared/config/database.yml"]
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."] queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."]