Module: Shuttle::Support::Bundler
Instance Method Summary collapse
- #bundle_install ⇒ Object
- #bundle_path ⇒ Object
- #bundler_installed? ⇒ Boolean
- #bundler_version ⇒ Object
- #install_bundler ⇒ Object
Instance Method Details
#bundle_install ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/shuttle/support/bundler.rb', line 26 def bundle_install log "Installing dependencies with Bundler" cmd = [ "bundle install", "--quiet", "--path #{bundle_path}", "--retry=3", "--binstubs", "--deployment", "--without development,test" ].join(' ') res = ssh.run("cd #{release_path} && #{cmd}", &method(:stream_output)) unless res.success? error "Unable to run bundle: #{res.output}" end end |
#bundle_path ⇒ Object
4 5 6 |
# File 'lib/shuttle/support/bundler.rb', line 4 def bundle_path shared_path('bundle') end |
#bundler_installed? ⇒ Boolean
8 9 10 |
# File 'lib/shuttle/support/bundler.rb', line 8 def bundler_installed? ssh.run("which bundle").success? end |
#bundler_version ⇒ Object
12 13 14 |
# File 'lib/shuttle/support/bundler.rb', line 12 def bundler_version ssh.capture("bundle --version").split(' ').last end |
#install_bundler ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/shuttle/support/bundler.rb', line 16 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 |