Sha256: 64f8debf753a0ed11a7ec47742a1f290df67a40f091beb7a1847c6a65a691719

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

require_relative 'ruby_version'

Capistrano::Configuration.instance(:must_exist).load do
  namespace :ndr_dev_support do
    desc 'Ensure gems outside the bundle are up to date'
    task :update_out_of_bundle_gems, except: { no_release: true } do
      # You can seed this list in your configuration with something like:
      #
      #   before 'ndr_dev_support:update_out_of_bundle_gems' do
      #     set :out_of_bundle_gems, webapp_deployment ? %w[puma] : %[god]
      #   end
      #
      gem_list = Array(fetch(:out_of_bundle_gems, []))

      # Extract the current version requirements for each of the gems from the lockfile,
      # and then check they're installed. If not, install them from the vendored cache.
      run <<~CMD if gem_list.any?
        export RBENV_VERSION=`cat "#{latest_release}/.ruby-version"`;
        cat "#{latest_release}/Gemfile.lock" | egrep "^    (#{gem_list.join('|')}) " | tr -d '()' | \
        while read gem ver; do
          gem list -i "$gem" --version "$ver" > /dev/null || \
          gem install "#{latest_release}/vendor/cache/$gem-$ver.gem" --ignore-dependencies \
                      --conservative --no-document;
        done
      CMD
    end
  end

  after 'bundle:install', 'ndr_dev_support:update_out_of_bundle_gems'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ndr_dev_support-4.1.1 lib/ndr_dev_support/capistrano/standalone_gems.rb
ndr_dev_support-4.1.0 lib/ndr_dev_support/capistrano/standalone_gems.rb
ndr_dev_support-4.0.0 lib/ndr_dev_support/capistrano/standalone_gems.rb