2019-04-04 16:26:17 +00:00
|
|
|
#!/bin/bash
|
2019-11-12 20:47:40 +00:00
|
|
|
set -eo pipefail
|
2019-04-04 16:26:17 +00:00
|
|
|
|
|
|
|
channel="${CHANNEL:-unstable}"
|
|
|
|
product="${PRODUCT:-inspec}"
|
|
|
|
version="${VERSION:-latest}"
|
|
|
|
|
|
|
|
echo "--- Installing $channel $product $version"
|
2019-06-20 04:45:52 +00:00
|
|
|
package_file="$(/opt/omnibus-toolchain/bin/install-omnibus-product -c "$channel" -P "$product" -v "$version" | tail -n 1)"
|
2019-04-04 16:26:17 +00:00
|
|
|
|
|
|
|
echo "--- Verifying omnibus package is signed"
|
2019-06-20 04:45:52 +00:00
|
|
|
/opt/omnibus-toolchain/bin/check-omnibus-package-signed "$package_file"
|
|
|
|
|
|
|
|
sudo rm -f "$package_file"
|
2019-04-04 16:26:17 +00:00
|
|
|
|
2019-05-16 03:22:26 +00:00
|
|
|
echo "--- Verifying ownership of package files"
|
2019-04-04 16:26:17 +00:00
|
|
|
|
2019-04-15 21:00:52 +00:00
|
|
|
export INSTALL_DIR=/opt/inspec
|
2019-06-20 04:45:52 +00:00
|
|
|
NONROOT_FILES="$(find "$INSTALL_DIR" ! -user 0 -print)"
|
2019-04-04 16:26:17 +00:00
|
|
|
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
|
|
|
|
|
2019-05-16 03:22:26 +00:00
|
|
|
echo "--- Running verification for $channel $product $version"
|
2019-04-04 16:26:17 +00:00
|
|
|
|
2019-07-16 16:24:36 +00:00
|
|
|
export CHEF_LICENSE="accept-no-persist"
|
2019-11-12 20:47:40 +00:00
|
|
|
project_root="$(pwd)"
|
|
|
|
export project_root
|
2019-04-04 16:26:17 +00:00
|
|
|
|
2019-11-12 20:47:40 +00:00
|
|
|
cd test/artifact
|
2019-07-10 02:09:29 +00:00
|
|
|
|
2019-11-12 20:47:40 +00:00
|
|
|
PATH=/opt/inspec/bin:/opt/inspec/embedded/bin:$PATH
|
|
|
|
export PATH
|
2019-07-10 02:09:29 +00:00
|
|
|
|
2019-11-12 20:47:40 +00:00
|
|
|
rake
|