CHEF-14881: Fix habitat pipeline for InSpec 6 (#7127)

* ci: update ruby version used for hab package

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* ci: update hab pipeline

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* ci: trigger hab pipeline for raised PR

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
This commit is contained in:
Sonu Saha 2024-08-12 18:54:08 +05:30 committed by GitHub
parent 5abbaa40c9
commit 997d41ea24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 3 deletions

View file

@ -6,7 +6,28 @@ export HAB_ORIGIN='ci'
export PLAN='inspec' export PLAN='inspec'
export CHEF_LICENSE="accept-no-persist" export CHEF_LICENSE="accept-no-persist"
export HAB_LICENSE="accept-no-persist" export HAB_LICENSE="accept-no-persist"
echo "--- checking if git is installed"
if ! command -v git &> /dev/null; then
echo "Git is not installed. Installing Git..."
sudo yum install -y git
else
echo "Git is already installed."
git --version
fi
echo "--- add an exception for this directory since detected dubious ownership in repository at /workdir"
git config --global --add safe.directory /workdir
echo "--- git status for this workdir"
git status
echo "--- ruby version"
ruby -v
export project_root="$(git rev-parse --show-toplevel)" export project_root="$(git rev-parse --show-toplevel)"
echo "The value for project_root is: $project_root"
export HAB_NONINTERACTIVE=true export HAB_NONINTERACTIVE=true
export HAB_NOCOLORING=true export HAB_NOCOLORING=true
export HAB_STUDIO_SECRET_HAB_NONINTERACTIVE=true export HAB_STUDIO_SECRET_HAB_NONINTERACTIVE=true
@ -46,6 +67,9 @@ if [ -f ./results/last_build.env ]; then
fi fi
echo "+++ Installing ${pkg_ident:?is undefined}" echo "+++ Installing ${pkg_ident:?is undefined}"
echo "++++"
echo $project_root
echo "+++"
hab pkg install -b "${project_root:?is undefined}/results/${pkg_artifact:?is undefined}" hab pkg install -b "${project_root:?is undefined}/results/${pkg_artifact:?is undefined}"
echo "--- Removing world readability from /usr/local/bundle" echo "--- Removing world readability from /usr/local/bundle"

View file

@ -25,7 +25,7 @@ pipelines:
- HAB_NONINTERACTIVE: "true" - HAB_NONINTERACTIVE: "true"
- HAB_NOCOLORING: "true" - HAB_NOCOLORING: "true"
- HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true" - HAB_STUDIO_SECRET_HAB_NONINTERACTIVE: "true"
# trigger: pull_request trigger: pull_request
- verify: - verify:
definition: .expeditor/verify_public_dummy.pipeline.yml definition: .expeditor/verify_public_dummy.pipeline.yml
description: Keeping the verify pipeline alive to preserve the history description: Keeping the verify pipeline alive to preserve the history

View file

@ -10,7 +10,7 @@ pkg_license=('Apache-2.0')
pkg_deps=( pkg_deps=(
core/coreutils core/coreutils
core/git core/git
core/ruby30 core/ruby31
core/bash core/bash
) )
pkg_build_deps=( pkg_build_deps=(
@ -80,7 +80,7 @@ export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH
export GEM_HOME="$GEM_HOME" export GEM_HOME="$GEM_HOME"
export GEM_PATH="$GEM_PATH" export GEM_PATH="$GEM_PATH"
exec $(pkg_path_for core/ruby30)/bin/ruby $real_bin \$@ exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin \$@
EOF EOF
chmod -v 755 "$bin" chmod -v 755 "$bin"
} }