aboutsummaryrefslogtreecommitdiff
path: root/.scripts.d/30-test.sh
diff options
context:
space:
mode:
authorChristian Segundo2024-04-07 10:45:05 +0200
committerChristian Segundo2024-04-07 18:19:48 +0200
commit8206fecdb86f05d353ef25c9596cebca5c1d28fb (patch)
tree169f50213c94e8a558bf1c235871c764045f4338 /.scripts.d/30-test.sh
parent3891426ce8deba513c5bcf1594987bdcfc837304 (diff)
downloadjenkins-agent-docker-cli-8206fecdb86f05d353ef25c9596cebca5c1d28fb.tar.gz
install buildx
Diffstat (limited to '.scripts.d/30-test.sh')
-rw-r--r--.scripts.d/30-test.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/.scripts.d/30-test.sh b/.scripts.d/30-test.sh
new file mode 100644
index 0000000..aacc15d
--- /dev/null
+++ b/.scripts.d/30-test.sh
@@ -0,0 +1,26 @@
+#!/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 GOSS_OPTS="--format junit --no-color"
+export CONTAINER_LOG_OUTPUT=${CONTAINER_LOG_OUTPUT:-}
+export GOSS_FILES_STRATEGY=cp
+
+goss --gossfile goss.yaml render >goss-full.yaml
+mv goss-full.yaml goss.yaml
+
+mkdir -p build/reports/
+dgoss run "chn2guevara/jenkins-agent-docker-cli:${BUILD_ID}" "/usr/bin/sleep" "infinity" >build/reports/goss.xml