forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
547ca1d
commit 62a592f
Showing
3 changed files
with
39 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
# default deployment branch is master which can be overwritten with BRANCH env var | ||
# BRANCH env var can be set to specific branch of tag, i.e 'v6.8.1' | ||
|
||
set :branch, ENV.include?('BRANCH') ? ENV['BRANCH'] : 'master' | ||
|
||
# Default deploy_to directory is /var/www/my_app | ||
set :deploy_to, "/srv/ontoportal/#{fetch(:application)}" | ||
|
@@ -42,7 +41,7 @@ | |
set :keep_releases, 5 | ||
set :bundle_without, 'development:test' | ||
set :bundle_config, { deployment: true } | ||
|
||
set :rails_env, "appliance" | ||
# Defaults to [:web] | ||
set :assets_roles, [:web, :app] | ||
set :keep_assets, 3 | ||
|
@@ -55,6 +54,40 @@ | |
# If you don't set `:passenger_restart_with_touch`, capistrano-passenger will check what version of passenger you are running | ||
# and use `passenger-config restart-app` if it is available in that version. | ||
|
||
# you can set custom ssh options | ||
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options | ||
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) | ||
# set it globally | ||
# set :ssh_options, { | ||
# keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(password) | ||
# } | ||
# and/or per server | ||
# server 'example.com', | ||
# user: 'user_name', | ||
# roles: %w{web app}, | ||
# ssh_options: { | ||
# user: 'user_name', # overrides user setting above | ||
# keys: %w(/home/user_name/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(publickey password) | ||
# # password: 'please use keys' | ||
# } | ||
# setting per server overrides global ssh_options | ||
set :ssh_options, { | ||
user: 'ontoportal', | ||
forward_agent: 'true', | ||
keys: %w(config/deploy_id_rsa), | ||
auth_methods: %w(publickey), | ||
# use ssh proxy if UI servers are on a private network | ||
proxy: Net::SSH::Proxy::Command.new('ssh [email protected] -W %h:%p') | ||
} | ||
|
||
#private git repo for configuraiton | ||
PRIVATE_CONFIG_REPO = ENV.include?('PRIVATE_CONFIG_REPO') ? ENV['PRIVATE_CONFIG_REPO'] : 'https://[email protected]/ontoportal-lirmm/ontoportal-configs.git' | ||
|
||
|
||
desc "Check if agent forwarding is working" | ||
task :forwarding do | ||
on roles(:all) do |h| | ||
|
@@ -66,6 +99,7 @@ | |
end | ||
end | ||
|
||
|
||
namespace :deploy do | ||
desc 'display remote system env vars' | ||
task :show_remote_env do | ||
|
@@ -82,8 +116,9 @@ | |
if defined?(PRIVATE_CONFIG_REPO) | ||
TMP_CONFIG_PATH = "/tmp/#{SecureRandom.hex(15)}".freeze | ||
on roles(:app) do | ||
info "Current environment: #{fetch(:stage)}" | ||
execute "git clone -q #{PRIVATE_CONFIG_REPO} #{TMP_CONFIG_PATH}" | ||
execute "rsync -a #{TMP_CONFIG_PATH}/#{fetch(:application)}/ #{release_path}/" | ||
execute "rsync -a #{TMP_CONFIG_PATH}/#{fetch(:application)}/#{fetch(:stage)}/ #{release_path}/" | ||
execute "rm -rf #{TMP_CONFIG_PATH}" | ||
end | ||
elsif defined?(LOCAL_CONFIG_PATH) | ||
|
@@ -102,6 +137,7 @@ | |
end | ||
|
||
|
||
after :updating, :get_config | ||
after :publishing, :restart | ||
|
||
after :restart, :clear_cache do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,35 +15,3 @@ | |
# extended properties on the server. | ||
#server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | ||
set :log_level, :error | ||
# you can set custom ssh options | ||
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options | ||
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) | ||
# set it globally | ||
# set :ssh_options, { | ||
# keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(password) | ||
# } | ||
# and/or per server | ||
# server 'example.com', | ||
# user: 'user_name', | ||
# roles: %w{web app}, | ||
# ssh_options: { | ||
# user: 'user_name', # overrides user setting above | ||
# keys: %w(/home/user_name/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(publickey password) | ||
# # password: 'please use keys' | ||
# } | ||
# setting per server overrides global ssh_options | ||
set :ssh_options, { | ||
user: 'deployer', | ||
forward_agent: 'true', | ||
keys: %w(config/deploy_id_rsa), | ||
auth_methods: %w(publickey), | ||
# use ssh proxy if UI servers are on a private network | ||
proxy: Net::SSH::Proxy::Command.new('ssh [email protected] -W %h:%p') | ||
} | ||
|
||
#private git repo for configuraiton | ||
PRIVATE_CONFIG_REPO = ENV.include?('PRIVATE_CONFIG_REPO') ? ENV['PRIVATE_CONFIG_REPO'] : '[email protected]:author/private_config_repo.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,35 +15,3 @@ | |
# extended properties on the server. | ||
#server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | ||
set :log_level, :error | ||
# you can set custom ssh options | ||
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options | ||
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) | ||
# set it globally | ||
# set :ssh_options, { | ||
# keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(password) | ||
# } | ||
# and/or per server | ||
# server 'example.com', | ||
# user: 'user_name', | ||
# roles: %w{web app}, | ||
# ssh_options: { | ||
# user: 'user_name', # overrides user setting above | ||
# keys: %w(/home/user_name/.ssh/id_rsa), | ||
# forward_agent: false, | ||
# auth_methods: %w(publickey password) | ||
# # password: 'please use keys' | ||
# } | ||
# setting per server overrides global ssh_options | ||
set :ssh_options, { | ||
user: 'deploy', | ||
forward_agent: 'true', | ||
keys: %w(config/deploy_id_rsa), | ||
auth_methods: %w(publickey), | ||
# use ssh proxy if UI servers are on a private network | ||
# proxy: Net::SSH::Proxy::Command.new('ssh [email protected] -W %h:%p') | ||
} | ||
|
||
#private git repo for configuraiton | ||
PRIVATE_CONFIG_REPO = ENV.include?('PRIVATE_CONFIG_REPO') ? ENV['PRIVATE_CONFIG_REPO'] : '[email protected]:author/private_config_repo.git' |