mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
fa1d9354e7
* Verify pipeline tests upgraded to ruby 3.1 Signed-off-by: Nik08 <nikita.mathur@progress.com> * Removed unused test fixtures of older ruby version Signed-off-by: Nik08 <nikita.mathur@progress.com> * Updates test fixtures from ruby 2.7 to ruby 3.0 & 3.1 Signed-off-by: Nik08 <nikita.mathur@progress.com> * Habitat package upgrade to ruby 31 Signed-off-by: Nik08 <nikita.mathur@progress.com> * Upgraded omnibus ruby version to ruby 3.1 Signed-off-by: Nik08 <nikita.mathur@progress.com> * Update ruby gem version in expeditor verify Signed-off-by: Nik08 <nikita.mathur@progress.com> * Update ruby gem version to ruby 3.3.3 in expeditor verify Signed-off-by: Nik08 <nikita.mathur@progress.com> * add ruby test 3.1 in verify pipeline (#5892) * add ruby test 3.1 in verify pipeline Signed-off-by: jayashri garud <jgarud@msystechnologies.com> * updating rubygem to 3.3.3 Signed-off-by: jayashri garud <jgarud@msystechnologies.com> * Test fixture plugin files for ABI 3.1.0 Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Use kwargs to match new calling style for ERB in ruby 2.7 and 3.0 Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Allow Date and Time data types, needed for waivers, since safe load is now the default for YAML Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Use Time.parse, not Time.new since the rules tightened for what you can pass the constructor for waiver dates Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Add ruby platform debug message to test parallel output Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * Conditionalize permitted_classes in inputs yaml_load for <= 3.1.x only Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> * In ruby 3.1.0 net/pop3 is no more a default gem and that will require us to add it in Gemfile so trying with the byebug gem which we are bundling already Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io> * CFINSPEC-166 Updated url fetcher to handle Net::OpenTimeout Exception on Windows Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io> Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com> Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io> * Inputs test fix as fixed in vasundhara/ruby-3-support Signed-off-by: Nik08 <nikita.mathur@progress.com> --------- Signed-off-by: Nik08 <nikita.mathur@progress.com> Co-authored-by: jayashrig158 <61735743+jayashrig158@users.noreply.github.com> Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com> Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
90 lines
2.4 KiB
Bash
90 lines
2.4 KiB
Bash
pkg_name=inspec
|
|
pkg_origin=chef
|
|
pkg_version=$(cat "$PLAN_CONTEXT/../VERSION")
|
|
pkg_description="InSpec is an open-source testing framework for infrastructure
|
|
with a human- and machine-readable language for specifying compliance,
|
|
security and policy requirements."
|
|
pkg_upstream_url=https://www.inspec.io/
|
|
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
|
|
pkg_license=('Apache-2.0')
|
|
pkg_deps=(
|
|
core/coreutils
|
|
core/git
|
|
core/ruby31
|
|
core/bash
|
|
)
|
|
pkg_build_deps=(
|
|
core/gcc
|
|
core/make
|
|
core/readline
|
|
core/sed
|
|
)
|
|
pkg_bin_dirs=(bin)
|
|
|
|
do_setup_environment() {
|
|
build_line 'Setting GEM_HOME="$pkg_prefix/lib"'
|
|
export GEM_HOME="$pkg_prefix/lib"
|
|
|
|
build_line "Setting GEM_PATH=$GEM_HOME"
|
|
export GEM_PATH="$GEM_HOME"
|
|
}
|
|
|
|
do_unpack() {
|
|
mkdir -pv "$HAB_CACHE_SRC_PATH/$pkg_dirname"
|
|
cp -RT "$PLAN_CONTEXT"/.. "$HAB_CACHE_SRC_PATH/$pkg_dirname/"
|
|
}
|
|
|
|
do_build() {
|
|
pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname/"
|
|
gem build inspec.gemspec
|
|
gem build inspec-core.gemspec
|
|
popd
|
|
pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname/inspec-bin"
|
|
gem build inspec-bin.gemspec
|
|
popd
|
|
}
|
|
|
|
do_install() {
|
|
# MUST install inspec first because inspec-bin depends on it via gemspec
|
|
pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname/"
|
|
gem install inspec-*.gem --no-document
|
|
popd
|
|
pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname/inspec-bin"
|
|
gem install inspec-bin*.gem --no-document
|
|
popd
|
|
|
|
wrap_inspec_bin
|
|
|
|
# ed25519 ssh key support done here as its a native gem we can't put in the gemspec
|
|
# for omnibus we also install this as part of the package
|
|
gem install ed25519 bcrypt_pbkdf --no-document
|
|
|
|
# Certain gems (timeliness) are getting installed with world writable files
|
|
# This is removing write bits for group and other.
|
|
find "$GEM_HOME" -xdev -perm -0002 -type f -print 2>/dev/null | xargs -I '{}' chmod go-w '{}'
|
|
}
|
|
|
|
# Need to wrap the InSpec binary to ensure paths are correct
|
|
wrap_inspec_bin() {
|
|
local bin="$pkg_prefix/bin/$pkg_name"
|
|
local real_bin="$GEM_HOME/gems/inspec-bin-${pkg_version}/bin/inspec"
|
|
build_line "Adding wrapper $bin to $real_bin"
|
|
cat <<EOF > "$bin"
|
|
#!$(pkg_path_for core/bash)/bin/bash
|
|
set -e
|
|
|
|
# Set binary path that allows InSpec to use non-Hab pkg binaries
|
|
export PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:\$PATH"
|
|
|
|
# Set Ruby paths defined from 'do_setup_environment()'
|
|
export GEM_HOME="$GEM_HOME"
|
|
export GEM_PATH="$GEM_PATH"
|
|
|
|
exec $(pkg_path_for core/ruby31)/bin/ruby $real_bin \$@
|
|
EOF
|
|
chmod -v 755 "$bin"
|
|
}
|
|
|
|
do_strip() {
|
|
return 0
|
|
}
|