Skip to content

Commit

Permalink
Absolute paths bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jul 23, 2020
1 parent 83cbc5d commit 4707a99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def compile
setup_language_pack_environment(
ruby_layer_path: File.expand_path("."),
gem_layer_path: File.expand_path("."),
bundle_path: "vendor/bundle",
bundle_path: File.expand_path("./vendor/bundle"),
bundle_default_without: "development:test"
)
allow_git do
Expand Down Expand Up @@ -427,11 +427,12 @@ def setup_export(layer = nil)
set_export_path "PATH", paths, layer

if layer
gem_path = "#{layer.path}/#{slug_vendor_base}"
core_path = layer.path
else
gem_path = "#{build_path}/#{slug_vendor_base}"
core_path = build_path
end
set_export_path "GEM_PATH", gem_path, layer

set_export_path "GEM_PATH", "#{core_path}/#{slug_vendor_base}", layer
set_export_default "LANG", "en_US.UTF-8", layer

# TODO handle jruby
Expand All @@ -442,10 +443,10 @@ def setup_export(layer = nil)
set_export_default "JRUBY_OPTS", default_jruby_opts
end

set_export_default "BUNDLE_PATH", ENV["BUNDLE_PATH"]
set_export_default "BUNDLE_WITHOUT", ENV["BUNDLE_WITHOUT"]
set_export_default "BUNDLE_BIN", ENV["BUNDLE_BIN"]
set_export_default "BUNDLE_DEPLOYMENT", ENV["BUNDLE_DEPLOYMENT"] if ENV["BUNDLE_DEPLOYMENT"]
set_export_default "BUNDLE_PATH", "#{core_path}/vendor/bundle", layer
set_export_default "BUNDLE_WITHOUT", ENV["BUNDLE_WITHOUT"], layer
set_export_default "BUNDLE_BIN", ENV["BUNDLE_BIN"], layer
set_export_default "BUNDLE_DEPLOYMENT", ENV["BUNDLE_DEPLOYMENT"], layer if ENV["BUNDLE_DEPLOYMENT"]
end
end

Expand Down Expand Up @@ -482,7 +483,7 @@ def setup_profiled(ruby_layer_path: , gem_layer_path: )
set_env_default "JRUBY_OPTS", default_jruby_opts
end

set_env_default "BUNDLE_PATH", ENV["BUNDLE_PATH"]
set_env_default "BUNDLE_PATH", "#{gem_layer_path}/vendor/bundle"
set_env_default "BUNDLE_WITHOUT", ENV["BUNDLE_WITHOUT"]
set_env_default "BUNDLE_BIN", ENV["BUNDLE_BIN"]
set_env_default "BUNDLE_DEPLOYMENT", ENV["BUNDLE_DEPLOYMENT"] if ENV["BUNDLE_DEPLOYMENT"]
Expand Down
2 changes: 1 addition & 1 deletion lib/language_pack/test/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def compile
setup_language_pack_environment(
ruby_layer_path: File.expand_path("."),
gem_layer_path: File.expand_path("."),
bundle_path: "vendor/bundle",
bundle_path: File.expand_path("./vendor/bundle"),
bundle_default_without: "development"
)
setup_export
Expand Down

0 comments on commit 4707a99

Please sign in to comment.