Sha256: e255737cfd9c70866b9ce6c7335ae6065fa00fd47d78dab3760b0b422788fa16

Contents?: true

Size: 978 Bytes

Versions: 15

Compression:

Stored size: 978 Bytes

Contents

module Shuttle
  module Support
    module Bundler
      def bundle_path
        shared_path('bundle')
      end

      def bundler_installed?
        ssh.run("which bundle").success?
      end

      def bundler_version
        ssh.capture("bundle --version").split(' ').last
      end

      def install_bundler
        res = ssh.run("gem install bundler")

        if res.success?
          log "Bundler installed: #{bundler_version}"
        else
          error "Bundler install failed: #{res.output}"
        end
      end

      def bundle_install
        log "Installing dependencies with Bundler"

        cmd = [
          "bundle install",
          "--quiet",
          "--path #{bundle_path}",
          "--binstubs",
          "--deployment"
        ].join(' ')

        res = ssh.run("cd #{release_path} && #{cmd}", &method(:stream_output))

        unless res.success?
          error "Unable to run bundle: #{res.output}"
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shuttle-deploy-0.2.0.beta16 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta15 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta14 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta13 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta12 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta11 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta10 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta9 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta7 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta6 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta5 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta4 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta3 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta2 lib/shuttle/support/bundler.rb
shuttle-deploy-0.2.0.beta1 lib/shuttle/support/bundler.rb