Class: Jenkins::Plugin::Tools::Bundle

Inherits:
Object
  • Object
show all
Defined in:
lib/jenkins/plugin/tools/bundle.rb

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Bundle

Returns a new instance of Bundle.



7
8
9
# File 'lib/jenkins/plugin/tools/bundle.rb', line 7

def initialize(target)
  @target = target
end

Instance Method Details

#installObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jenkins/plugin/tools/bundle.rb', line 11

def install
  require 'java'
  require 'bundler'
  puts "bundling..."

  # We set these in ENV instead of passing the --without and --path
  # options because the CLI options are remembered in .bundle/config and
  # will interfere with regular usage of bundle exec / install.
  Bundler.with_clean_env {
    ENV['BUNDLE_APP_CONFIG'] = "#{@target}/vendor/bundle"
    ENV['BUNDLE_WITHOUT'] =  "development"
    ENV['BUNDLE_PATH'] = "#{@target}/vendor/gems"
    ENV.delete 'RUBYOPT'
    system('bundle --standalone')
  }
end