Skip to content

Commit

Permalink
Added the kitchen_gem script into the bin for test kitchen, any other…
Browse files Browse the repository at this point in the history
… component that will need to install a custom gem will also need a similar <component_name>_gem script. This script will install kitchen related plugins in the /hab/kitchen directory and execute the install command will the appropriate arguments, in the context of the appropriate version for kitchen as set by the user.

Signed-off-by: Prajakta Purohit <[email protected]>
  • Loading branch information
PrajaktaPurohit committed Dec 19, 2024
1 parent 0905d96 commit b7b0fae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/kitchen_gem
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# expected to be invoked as kitchen install-gem <gem_name>
export GEM_HOME="/hab/kitchen"
env_version=$KITCHEN_VERSION

if [[ -z "$env_version" ]]; then
# it will install the latest version if a new version installed unless the version env variable was set
hab pkg exec $origin/$package gem install -- $@
else
hab pkg exec $origin/$package/$env_version gem install -- $@
fi

0 comments on commit b7b0fae

Please sign in to comment.