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-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-22 06:23:17 +00:00
|
|
|
HAB_CI_KEY=$(realpath "$HOME"/.hab/cache/keys/"$HAB_ORIGIN"*.pub)
|
2019-10-22 06:01:19 +00:00
|
|
|
export HAB_CI_KEY
|
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-22 09:26:52 +00:00
|
|
|
export pkg_artifact
|
2019-11-06 22:31:47 +00:00
|
|
|
export project_root
|
2019-10-19 00:56:42 +00:00
|
|
|
fi
|
2019-10-17 02:57:45 +00:00
|
|
|
|
2019-10-22 03:21:26 +00:00
|
|
|
echo "+++ Installing ${pkg_ident:?is undefined}"
|
2019-10-21 21:11:47 +00:00
|
|
|
|
2019-10-22 09:06:53 +00:00
|
|
|
# habitat sudo install
|
|
|
|
HSI="$project_root"/.expeditor/buildkite/artifact.habitat.install.sh
|
2019-10-22 03:52:24 +00:00
|
|
|
|
2019-10-22 09:06:53 +00:00
|
|
|
sudo -E "$HSI"
|
2019-10-22 03:21:26 +00:00
|
|
|
|
2019-10-22 06:27:53 +00:00
|
|
|
echo "+++ Testing $PLAN"
|
2019-11-06 22:31:47 +00:00
|
|
|
|
|
|
|
PATH="/hab/bin:$PATH"
|
|
|
|
export PATH
|
|
|
|
|
2019-10-22 06:27:53 +00:00
|
|
|
pushd "$project_root/test/artifact"
|
2019-11-06 22:31:47 +00:00
|
|
|
hab pkg exec core/ruby rake
|
2019-10-22 06:27:53 +00:00
|
|
|
popd
|