aboutsummaryrefslogtreecommitdiff
path: root/tasks/dgoss
diff options
context:
space:
mode:
authorChristian Segundo2023-12-30 05:28:03 +0100
committerChristian Segundo2023-12-31 00:20:01 +0100
commit786cd19a227a20b352b0764c9546c35fa5249ce8 (patch)
tree2613c346a3ed97cc399656d6e3d27ac906738e46 /tasks/dgoss
parent2f0253c36f80b8f11e3294d184a5e73d0fec76a4 (diff)
downloadconcourse-786cd19a227a20b352b0764c9546c35fa5249ce8.tar.gz
add tasks
Diffstat (limited to 'tasks/dgoss')
-rw-r--r--tasks/dgoss/task.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/tasks/dgoss/task.yml b/tasks/dgoss/task.yml
new file mode 100644
index 0000000..8727487
--- /dev/null
+++ b/tasks/dgoss/task.yml
@@ -0,0 +1,47 @@
+---
+platform: linux
+image_resource:
+ type: registry-image
+ source: {repository: debian}
+
+inputs:
+ - name: docker-repo
+ - name: image
+
+run:
+ path: /bin/bash
+ args:
+ - -eufo
+ - pipefail
+ - -c
+ - |
+ apt-get update
+ apt-get install --no-install-recommends -y \
+ ca-certificates \
+ curl \
+ fuse-overlayfs \
+ podman
+
+ curl -fsSL https://goss.rocks/install | sh
+
+ export GOSS_SLEEP=${GOSS_SLEEP:-5}
+ export CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-podman}
+ export INPUT_TAR=${INPUT_TAR:-image/image.tar}
+
+ if [ -f docker-repo/goss.yaml ]; then
+ # 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)' docker-repo/Dockerfile; then
+ export GOSS_FILES_STRATEGY=cp
+ fi
+ goss --gossfile docker-repo/goss.yaml render > goss.yaml
+ dgoss run docker-archive:${INPUT_TAR}
+ else
+ echo "You're a naughty boy, no goss.yaml file found!" >&2
+ fi
+
+params:
+ CONTAINER_RUNTIME:
+ GOSS_SLEEP:
+ INPUT_TAR: