Skip to content
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

Using SSHKit prefixes to hook RVM #22

Merged
merged 3 commits into from
Nov 23, 2013
Merged

Using SSHKit prefixes to hook RVM #22

merged 3 commits into from
Nov 23, 2013

Conversation

kirs
Copy link
Member

@kirs kirs commented Nov 19, 2013

Here is the first implementation using SSHKit prefixes: capistrano/sshkit#45

@@ -63,11 +43,13 @@ namespace :rvm do
end
end

before 'deploy:starting', 'rbenv:hook'
before 'deploy:starting', 'rbenv:check'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be RVM - not rbenv?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. Fixed

@Kriechi
Copy link
Contributor

Kriechi commented Nov 19, 2013

Bundler bin is not mapped any more. How do we address this issue - in combination with command map?

I think it is not a good idea to specify an addition rvm-map-bin entry inside capistrano-bundler...
So we need a sane default here in capistrano-{rvm,rbenv}

@kirs
Copy link
Member Author

kirs commented Nov 19, 2013

Bundler bin is not mapped any more. How do we address this issue - in combination with command map?

Now it's done inside bundler: https://github.com/capistrano/bundler/pull/16/files#diff-91990b1845e3608397d87393341f0544R31

If you mean that someone is using execute :bundle, "exec some_task", there are 2 ways:

  1. Declare this way as not recommended and tell developers to add some_task to bundle_bins instead.
  2. Keep mapping bundle to avoid regressions

@Kriechi
Copy link
Contributor

Kriechi commented Nov 19, 2013

Hmm - I mean, if I try execute(:bundle, 'install') - will RVM be invoked?
Because :bundle is not in rvm-map-bin...

Yes, if someone wants to bundle exec something, they have to add it to bundle-bins. Thats fine.

@kirs
Copy link
Member Author

kirs commented Nov 19, 2013

You're right, I've fixed it.

@kirs
Copy link
Member Author

kirs commented Nov 22, 2013

@Kriechi it works for me on capistrano 3.1 from upstream, SSHKit 1.2.0 and capistrano-rvm from this branch.

I would appreciate if you try it too 😉


Capistrano::DSL.stages.each do |stage|
after stage, 'rvm:hook'
after stage, 'rvm:check'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with that in place, the section https://github.com/capistrano/rvm#custom-tasks-which-rely-on-rvmruby is not needed any more, or is it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@Kriechi
Copy link
Contributor

Kriechi commented Nov 23, 2013

👍 It works!
Good to merge!

@kirs
Copy link
Member Author

kirs commented Nov 23, 2013

Awesome. Your tried the whole rails/bundler/rvm workflow, right?

@Kriechi
Copy link
Contributor

Kriechi commented Nov 23, 2013

  gem 'capistrano', github: 'capistrano/capistrano'
  gem 'capistrano-rvm',     github: 'capistrano/rvm', branch: 'sshkit-prefixes'
  gem 'capistrano-bundler', github: 'capistrano/bundler', branch: 'sshkit-prefixes'
  gem 'capistrano-rails',   github: 'capistrano/rails'

and

require 'capistrano/setup'
require 'capistrano/deploy'

require 'capistrano/rvm'
require 'capistrano/rails'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

deploy.rb and stage-files basically just like the templates.

kirs added a commit that referenced this pull request Nov 23, 2013
Using SSHKit prefixes to hook RVM
@kirs kirs merged commit 8a3ecb0 into master Nov 23, 2013
@kirs kirs deleted the sshkit-prefixes branch November 23, 2013 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants