diff options
Diffstat (limited to '.scripts.d/30-test.sh')
-rw-r--r-- | .scripts.d/30-test.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/.scripts.d/30-test.sh b/.scripts.d/30-test.sh new file mode 100644 index 0000000..4ec890d --- /dev/null +++ b/.scripts.d/30-test.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# vim: ai:ts=8:sw=8:noet +set -EeufCo pipefail +export SHELLOPTS # propagate set to children by default +IFS=$'\t\n' + +# check required commands are in place +command -v docker >/dev/null 2>&1 || { + echo 'please install docker-client' + exit 1 +} + +# install goss +curl -fsSL https://goss.rocks/install | sh + +export GOSS_SLEEP=${GOSS_SLEEP:-5} +export GOSS_VARS=${GOSS_VARS:-} +export CONTAINER_LOG_OUTPUT=${CONTAINER_LOG_OUTPUT:-} + +# The default 'mount' strategy uses 'sleep infinity' to keep +# the container alive. If there's an ENTRYPOINT or CMD, use 'cp' +# instead to prevent dgoss from overriding it. +if grep -qE '^(ENTRYPOINT|CMD)' Dockerfile; then + export GOSS_FILES_STRATEGY=cp +fi + +goss --gossfile goss.yaml render >goss-full.yaml +mv goss-full.yaml goss.yaml + +dgoss run "chn2guevara/languagetool:${BUILD_ID}" |