-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load capistrano-rvm only in staging environment #49
Comments
👍 |
can patch Capfile like. as it is a Rakefile task :use_rvm do
require 'capistrano/rvm'
end
task 'staging' => [:use_rvm] my full # Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
task :use_rvm do
require 'capistrano/rvm'
end
task 'staging' => [:use_rvm]
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } rake version is |
Using the task pattern described before, There are two ways to make this work:
Capfiletask :require_rvm do
require 'capistrano/rvm'
end
task 'staging' => [:require_rvm]
require 'capistrano/bundler' config/deploy/staging.rbset :bundle_bins, %w(gem rake rails)
Capfiletask :require_rvm do
require 'capistrano/rvm'end
task :require_bundler do
require 'capistrano/bundler'
end
task 'staging' => [:require_rvm, :require_bundler]
task 'production' => [:require_bundler] |
I have been adding no_hooks to several capistrano gems, so you can load many capistrano plugins on a per-deploy task without any dirty hacks like this one, I'll add a PR soon |
Due to historic reasons i use rbenv in production and rvm in staging environment.
The problem is now, that I cannot load capistrano-rvm in the staging.rb cap file:
But if I move the "require 'capistrano/rvm'" it in the Capfile, it also gets loaded in the production environment:
How do I load capistrano-rvm only in staging?
Thanks!
The text was updated successfully, but these errors were encountered: