Created
November 14, 2018 17:24
-
-
Save thbar/b9d463277411ec9468c10d6dc252a24f to your computer and use it in GitHub Desktop.
variable_based_ruby_version_override_in_capistrano.rb
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
set :rvm_ruby_version do | |
fetch(:override_rvm_ruby_version, IO.read('.ruby-version').strip) | |
end | |
after 'deploy:updating', 'custom:tweak_ruby_version' do | |
ruby_version = fetch(:override_rvm_ruby_version, nil) | |
next unless ruby_version | |
on roles :all do | |
info "Overwriting .ruby-version with #{ruby_version.inspect}" | |
content = StringIO.new(ruby_version) | |
upload! content, File.join(fetch(:release_path), '.ruby-version') | |
end | |
end |
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
set :override_rvm_ruby_version, 'jruby-9.2.4.0' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment