2019-10-17 02:57:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -ueo pipefail
|
|
|
|
|
|
|
|
export HAB_ORIGIN='ci'
|
|
|
|
export PLAN='inspec'
|
2019-10-21 21:46:04 +00:00
|
|
|
export CHEF_LICENSE="accept-no-persist"
|
2019-10-21 23:16:37 +00:00
|
|
|
export HAB_LICENSE="accept-no-persist"
|
2019-10-22 01:46:46 +00:00
|
|
|
export CI_USER=$(whoami)
|
2019-10-17 02:57:45 +00:00
|
|
|
|
|
|
|
echo "--- system details"
|
|
|
|
uname -a
|
|
|
|
|
|
|
|
echo "--- Generating fake origin key"
|
2019-10-19 00:56:42 +00:00
|
|
|
hab origin key generate $HAB_ORIGIN
|
2019-10-17 02:57:45 +00:00
|
|
|
|
|
|
|
echo "--- Building $PLAN"
|
|
|
|
project_root="$(git rev-parse --show-toplevel)"
|
|
|
|
cd "$project_root"
|
|
|
|
|
|
|
|
DO_CHECK=true hab pkg build .
|
|
|
|
|
2019-10-21 20:20:48 +00:00
|
|
|
echo "--- Sourcing 'results/last_build.sh'"
|
2019-10-21 20:31:37 +00:00
|
|
|
if [ -f ./results/last_build.env ]; then
|
|
|
|
. ./results/last_build.env
|
2019-10-19 00:56:42 +00:00
|
|
|
fi
|
2019-10-17 02:57:45 +00:00
|
|
|
|
2019-10-21 20:20:48 +00:00
|
|
|
echo "--- Installing ${pkg_ident:?is undefined}"
|
2019-10-21 21:11:47 +00:00
|
|
|
|
2019-10-22 02:36:16 +00:00
|
|
|
sudo -E "cat ~$CI_USER/.hab/cache/keys/$HAB_ORIGIN*.pub | /usr/bin/hab origin key import"
|
2019-10-21 23:16:48 +00:00
|
|
|
sudo -E hab pkg install "./results/${pkg_artifact:?is undefined}"
|
2019-10-17 02:57:45 +00:00
|
|
|
|
2019-10-21 20:20:48 +00:00
|
|
|
echo "+++ Testing $PLAN"
|
|
|
|
pushd "$project_root/test/artifact"
|
|
|
|
rake
|
|
|
|
popd
|