inspec/.expeditor/buildkite/artifact.habitat.test.sh
Miah Johnson 13a1c30ba6 Corret build scripts
correct path to hab artifact
Rather than throwing, lets try to install the version
Make sure hab is in the path
we use -b on windows. lets be consistent
export project_root too
picardface
fix regex
execute rake _through_ habitat
make test vrooom
test presence of inspec
strip out clixml bs
... no which on bk.
full path to which
export PATH
test exist on linux/windows

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-11-07 10:09:35 -08:00

45 lines
941 B
Bash
Executable file

#!/usr/bin/env bash
set -ueo pipefail
export HAB_ORIGIN='ci'
export PLAN='inspec'
export CHEF_LICENSE="accept-no-persist"
export HAB_LICENSE="accept-no-persist"
echo "--- system details"
uname -a
echo "--- Generating fake origin key"
hab origin key generate $HAB_ORIGIN
HAB_CI_KEY=$(realpath "$HOME"/.hab/cache/keys/"$HAB_ORIGIN"*.pub)
export HAB_CI_KEY
echo "--- Building $PLAN"
project_root="$(git rev-parse --show-toplevel)"
cd "$project_root"
DO_CHECK=true hab pkg build .
echo "--- Sourcing 'results/last_build.sh'"
if [ -f ./results/last_build.env ]; then
. ./results/last_build.env
export pkg_artifact
export project_root
fi
echo "+++ Installing ${pkg_ident:?is undefined}"
# habitat sudo install
HSI="$project_root"/.expeditor/buildkite/artifact.habitat.install.sh
sudo -E "$HSI"
echo "+++ Testing $PLAN"
PATH="/hab/bin:$PATH"
export PATH
pushd "$project_root/test/artifact"
hab pkg exec core/ruby rake
popd