Skip to content
Snippets Groups Projects
Verified Commit 9ce8c0b7 authored by Alexander Wellbrock's avatar Alexander Wellbrock
Browse files

shell-tools: add test-cases for manifests

parent 02a128dc
No related branches found
No related tags found
No related merge requests found
Pipeline #5499 passed
......@@ -16,4 +16,7 @@ shell-tools-test:
stage: shell-tools-test
script:
- ./resources/shell-tools/test/fix-dockerfile-pinning.sh
- ./resources/shell-tools/test/multiarch.sh
- ./resources/shell-tools/test/manifest.sh
- ./resources/shell-tools/test/manifest-latest.sh
- ./resources/shell-tools/test/manifest-print.sh
- ./resources/shell-tools/test/manifest-push.sh
#!/bin/bash
set -o pipefail
set -u
BASEDIR=$(dirname "$0")
podman build --format docker -t mytest-latest:test-amd64 -f- <<EOF
FROM scratch
EOF
podman build --format docker -t mytest-latest:test-arm64 -f- <<EOF
FROM scratch
EOF
"$BASEDIR"/../bin/manifest.sh --local --latest mytest-latest:test registry.example.com/latest-test 1.2.3
ERRORS=0
podman manifest inspect registry.example.com/latest-test:latest
ERRORS=$((ERRORS + "$?"))
if [ "$ERRORS" = "0" ]; then
EXIT_CODE=0
else
EXIT_CODE=1
fi
podman rmi -f registry.example.com/latest-test:1 \
registry.example.com/latest-test:1.2 \
registry.example.com/latest-test:1.2.3 \
registry.example.com/latest-test:latest
podman rmi -f "$(podman images -q mytest-latest:test-amd64)"
podman rmi -f "$(podman images -q mytest-latest:test-arm64)"
exit $EXIT_CODE
#!/bin/bash
set -o pipefail
set -u
BASEDIR=$(dirname "$0")
podman build --format docker -t mytest-latest:test-amd64 -f- <<EOF
FROM scratch
EOF
podman build --format docker -t mytest-latest:test-arm64 -f- <<EOF
FROM scratch
EOF
MANIFESTS_TO_PUSH=$("$BASEDIR"/../bin/manifest.sh --local --print mytest-latest:test registry.example.com/latest-test 1.2.3)
EXIT_CODE=1
if [ "$MANIFESTS_TO_PUSH" == "registry.example.com/latest-test:1 registry.example.com/latest-test:1.2 registry.example.com/latest-test:1.2.3" ]; then
EXIT_CODE=0
fi
podman rmi -f registry.example.com/latest-test:1 \
registry.example.com/latest-test:1.2 \
registry.example.com/latest-test:1.2.3
podman rmi -f "$(podman images -q mytest-latest:test-amd64)"
podman rmi -f "$(podman images -q mytest-latest:test-arm64)"
exit $EXIT_CODE
#!/bin/bash
set -o pipefail
set -u
BASEDIR=$(dirname "$0")
podman build --format docker -t mytest-latest:test-amd64 -f- <<EOF
FROM scratch
EOF
podman build --format docker -t mytest-latest:test-arm64 -f- <<EOF
FROM scratch
EOF
MANIFESTS_TO_PUSH=$("$BASEDIR"/../bin/manifest.sh --archs="amd64:arm64" --local --print mytest-latest:test registry.example.com/latest-test 1.2.3)
EXIT_CODE=1
PUSHED=$("$BASEDIR"/../bin/manifest-push.sh --dry "$MANIFESTS_TO_PUSH")
if [ "$PUSHED" == "registry.example.com/latest-test:1 registry.example.com/latest-test:1.2 registry.example.com/latest-test:1.2.3" ]; then
EXIT_CODE=0
fi
podman rmi -f registry.example.com/latest-test:1 \
registry.example.com/latest-test:1.2 \
registry.example.com/latest-test:1.2.3
podman rmi -f "$(podman images -q mytest-latest:test-amd64)"
podman rmi -f "$(podman images -q mytest-latest:test-arm64)"
exit $EXIT_CODE
#!/bin/bash
set -o pipefail
set -u
BASEDIR=$(dirname "$0")
podman build --format docker -t mytest-latest:test-amd64 -f- <<EOF
FROM scratch
EOF
podman build --format docker -t mytest-latest:test-arm64 -f- <<EOF
FROM scratch
EOF
"$BASEDIR"/../bin/manifest.sh --archs="amd64:arm64" --local mytest-latest:test registry.example.com/latest-test 1.2.3
ERRORS=0
podman manifest inspect registry.example.com/latest-test:1
ERRORS=$((ERRORS + "$?"))
podman manifest inspect registry.example.com/latest-test:1.2
ERRORS=$((ERRORS + "$?"))
podman manifest inspect registry.example.com/latest-test:1.2.3
ERRORS=$((ERRORS + "$?"))
if [ "$ERRORS" = "0" ]; then
EXIT_CODE=0
else
EXIT_CODE=1
fi
podman rmi -f registry.example.com/latest-test:1 \
registry.example.com/latest-test:1.2 \
registry.example.com/latest-test:1.2.3
podman rmi -f "$(podman images -q mytest-latest:test-amd64)"
podman rmi -f "$(podman images -q mytest-latest:test-arm64)"
exit $EXIT_CODE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment