lib/railman/tasks/set_railman_env.rake in railman-deployment-1.1.4 vs lib/railman/tasks/set_railman_env.rake in railman-deployment-2.0.0
- old
+ new
@@ -1,24 +1,20 @@
task :set_railman_env do
set :deploy_to, "/home/deploy/apps/#{fetch(:application)}"
- if fetch(:spa_application)
- set :deploy_spa_to, "/home/deploy/sites/#{fetch(:spa_application)}"
- end
- set :rbenv_home, '/home/deploy/.rbenv'
- set :environment, {path: "#{fetch(:rbenv_home)}/shims:#{fetch(:rbenv_home)}/bin:$PATH", rails_env: 'production'}
+ set :environment, { rails_env: 'production'}
+ set :chruby_prefix, "/usr/local/bin/chruby-exec #{fetch(:chruby_ruby)} -- RAILS_ENV=production "
- SSHKit.config.command_map[:rake] = "#{fetch(:deploy_to)}/bin/rake"
- %w(ln cp service start restart stop status certbot).each do |cmd|
+ SSHKit.config.command_map[:rake] = "#{fetch(:chruby_prefix)} #{fetch(:deploy_to)}/bin/rake"
+ SSHKit.config.command_map[:bundle] = "#{fetch(:chruby_prefix)} #{fetch(:deploy_to)}/bin/bundle"
+ %w(systemctl certbot).each do |cmd|
SSHKit.config.command_map[cmd.to_sym] = "sudo #{cmd}"
end
- SSHKit.config.command_map[:eye] = "#{fetch(:rbenv_home)}/shims/eye"
SSHKit.config.command_map[:su_rm] = 'sudo rm'
+ SSHKit.config.command_map[:su_ln] = 'sudo ln'
+ SSHKit.config.command_map[:su_cp] = 'sudo cp'
end
before :setup, :set_railman_env
-before :setup_spa, :set_railman_env
before :deploy, :set_railman_env
-before :deploy_spa, :set_railman_env
-before :deploy_all, :set_railman_env
before :update, :set_railman_env
before :reset_server, :set_railman_env
before :remove, :set_railman_env