Skip to content

Commit

Permalink
- Point GEM_HOME to the package/vendor directory. This will resolve t…
Browse files Browse the repository at this point in the history
…o pkg/vendor/gems instead of package/vendor/gems/gems as done in the current hab install.

- Create and add the /hab/kitchen directory to the GEM_PATH. With this change the GEM_PATHS will look like
  - GEM PATHS:
     - /hab/pkgs/core/ruby3_1/3.1.6/20241017135756/lib/ruby/gems/3.1.0
     - /hab/pkgs/chef/chef-infra-client/19.0.60/20241216200649/vendor
     - /hab/kitchen

Signed-off-by: Prajakta Purohit <[email protected]>
  • Loading branch information
PrajaktaPurohit committed Dec 19, 2024
1 parent fbb588a commit 0905d96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ do_unpack() {

do_build() {
echo $(pkg_path_for $_chef_client_ruby)
export GEM_HOME="$pkg_prefix/vendor/gems"
export GEM_HOME="$pkg_prefix/vendor"

build_line "Setting GEM_PATH=$GEM_HOME"
export GEM_PATH="$GEM_HOME"
Expand All @@ -50,6 +50,7 @@ do_build() {
}

do_install() {
mkdir -p /hab/kitchen
export GEM_HOME="$pkg_prefix/vendor/gems"

build_line "Setting GEM_PATH=$GEM_HOME"
Expand All @@ -58,7 +59,7 @@ do_install() {
gem install chef-cli
wrap_ruby_kitchen
wrap_ruby_chef_cli
set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems"
set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems;/hab/kitchen"
}

wrap_ruby_kitchen() {
Expand Down Expand Up @@ -95,4 +96,4 @@ EOF

do_strip() {
return 0
}
}

0 comments on commit 0905d96

Please sign in to comment.