From b7b0faee9cfa008921165eca381688810e64d99c Mon Sep 17 00:00:00 2001 From: Prajakta Purohit Date: Thu, 19 Dec 2024 09:46:31 -0800 Subject: [PATCH] Added the kitchen_gem script into the bin for test kitchen, any other component that will need to install a custom gem will also need a similar _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 --- bin/kitchen_gem | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bin/kitchen_gem diff --git a/bin/kitchen_gem b/bin/kitchen_gem new file mode 100644 index 000000000..7bd3d4592 --- /dev/null +++ b/bin/kitchen_gem @@ -0,0 +1,12 @@ +#!/bin/bash + +# expected to be invoked as kitchen install-gem +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 \ No newline at end of file