Sha256: 2cb0320e02c33fd345c038d852434866def3f01747ff395d7767f5beddef04c2

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

Capistrano::Configuration.instance(:must_exist).load do

set :bundle_without, "test development" unless exists?(:bundle_without)

  namespace :bundler do
    desc "Automatically installed your bundled gems if a Gemfile exists"
    task :bundle_gems, :roles => :app, :except => {:no_bundle => true} do
      parallel(options) do |session|
        rvm_role = fetch(:rvm_require_role,"rvm")
        session.when "in?(:#{rvm_role})", <<-SHELL.split("\n").map(&:strip).join("; ")
          if [ -f #{release_path}/Gemfile ]
          then cd #{release_path} && bundle install --without=#{bundle_without} --system
          fi
        SHELL
        session.else <<-SHELL.split("\n").map(&:strip).join("; ")
          mkdir -p #{shared_path}/bundled_gems
          if [ -f #{release_path}/Gemfile ]
          then cd #{release_path} && bundle install --without=#{bundle_without} --binstubs #{release_path}/bin --path #{shared_path}/bundled_gems
          fi
          if [ ! -h #{release_path}/bin ]
          then ln -nfs #{release_path}/bin #{release_path}/ey_bundler_binstubs
          fi
        SHELL
      end
    end
    after "deploy:symlink_configs","bundler:bundle_gems"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eycap-0.6.6 lib/eycap/recipes/bundler.rb