Sha256: 34e20e9d0e12809f767ca90fadc189a7a596c8ae9e13d892164a06e0b06f769b

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

######################################################################
#                             RVM TASKS                              #
######################################################################
def run_with_rvm(ruby_env_string, command)
  run("rvm use #{ruby_env_string} && #{command}")
end

Capistrano::Configuration.instance(:must_exist).load do
  run_task 'ruby:update', :as => manager_username

  namespace :ruby do
    desc <<-DESC
      During the deployment, the wrapper ruby executable used by the
      application server will be switched to utilize the ruby sepecified
      by the application.

      Note: This is only available during a subzero deployment since the web
      server will need to be restarted in order for the changes to take effect.
    DESC
    task :update do
      if ruby_version_update_pending
        after   'ruby:update',    'gems:clean', 'gems:install'

        set     :ruby_version_update_pending,   false

        run("rvm use --create #{rvm_ruby_string}")
        run("rvm wrapper #{rvm_ruby_string} #{application_server_type}")
      else
        set     :ruby_version_update_pending,   true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chicken_soup-0.5.3 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb
chicken_soup-0.5.2 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb
chicken_soup-0.5.0 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb