diff options
author | Christian Segundo | 2023-12-30 05:28:03 +0100 |
---|---|---|
committer | Christian Segundo | 2023-12-31 00:20:01 +0100 |
commit | 786cd19a227a20b352b0764c9546c35fa5249ce8 (patch) | |
tree | 2613c346a3ed97cc399656d6e3d27ac906738e46 /tasks/dgoss/task.yml | |
parent | 2f0253c36f80b8f11e3294d184a5e73d0fec76a4 (diff) | |
download | concourse-786cd19a227a20b352b0764c9546c35fa5249ce8.tar.gz |
add tasks
Diffstat (limited to 'tasks/dgoss/task.yml')
-rw-r--r-- | tasks/dgoss/task.yml | 47 |
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: |