mirror of
https://github.com/inspec/inspec
synced 2024-11-24 13:43:09 +00:00
45070c15c0
Signed-off-by: Miah Johnson <miah@chia-pet.org>
39 lines
1 KiB
Bash
39 lines
1 KiB
Bash
#!/bin/bash
|
|
set -eo pipefail
|
|
|
|
channel="${CHANNEL:-unstable}"
|
|
product="${PRODUCT:-inspec}"
|
|
version="${VERSION:-latest}"
|
|
|
|
echo "--- Installing $channel $product $version"
|
|
package_file="$(/opt/omnibus-toolchain/bin/install-omnibus-product -c "$channel" -P "$product" -v "$version" | tail -n 1)"
|
|
|
|
echo "--- Verifying omnibus package is signed"
|
|
/opt/omnibus-toolchain/bin/check-omnibus-package-signed "$package_file"
|
|
|
|
sudo rm -f "$package_file"
|
|
|
|
echo "--- Verifying ownership of package files"
|
|
|
|
export INSTALL_DIR=/opt/inspec
|
|
NONROOT_FILES="$(find "$INSTALL_DIR" ! -user 0 -print)"
|
|
if [[ "$NONROOT_FILES" == "" ]]; then
|
|
echo "Packages files are owned by root. Continuing verification."
|
|
else
|
|
echo "Exiting with an error because the following files are not owned by root:"
|
|
echo "$NONROOT_FILES"
|
|
exit 1
|
|
fi
|
|
|
|
echo "--- Running verification for $channel $product $version"
|
|
|
|
export CHEF_LICENSE="accept-no-persist"
|
|
project_root="$(pwd)"
|
|
export project_root
|
|
|
|
cd test/artifact
|
|
|
|
PATH=/opt/inspec/bin:/opt/inspec/embedded/bin:$PATH
|
|
export PATH
|
|
|
|
rake
|