Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Praj/sample workstation package #19

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
}
}
Loading