Skip to content

Commit 6ad73da

Browse files
committed
chore(ci): update release workflow for multi distro
1 parent 663b996 commit 6ad73da

9 files changed

Lines changed: 40 additions & 24 deletions

File tree

script/.trivyignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ CVE-2019-16227
3737
CVE-2026-42217
3838
CVE-2026-24450
3939
CVE-2026-24660
40+
CVE-2026-57433
41+
CVE-2026-63970
42+
CVE-2026-64600
4043
# Debian high vulns
44+
CVE-2026-53399
45+
CVE-2026-64017
46+
CVE-2026-36849
4147
CVE-2013-7445
4248
CVE-2019-16226
4349
CVE-2019-16228

script/release-workflow/docker-build.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ set -euo >/dev/null
55
## This will allow for local use for testing or scanning with trivy (multi-manifest builds cannot be imported)
66
## we will build a multi-manifest build during ./docker-push.sh
77
ARCHES=${ARCHES:-'amd64'}
8-
9-
DEBIAN=${IS_DEBIAN:+"-debian"}
10-
8+
: "${IS_DEBIAN:=}"
119
DOCKER_IMAGE_ORG_AND_NAME="${DOCKER_REPOSITORY:-pactfoundation}/pact-broker"
1210
for arch in $ARCHES; do
1311
docker buildx build \
1412
--platform linux/$arch \
1513
--build-arg VERSION="${TAG:-dev}" \
1614
--output type=docker \
17-
--tag ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${arch}${DEBIAN} \
15+
--tag ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${arch}${IS_DEBIAN:+"-debian"} \
1816
-f Dockerfile${IS_DEBIAN:+.debian} \
1917
.
2018
done

script/release-workflow/docker-push.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ push() {
1111
--annotation "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
1212
--annotation "org.opencontainers.image.revision=$GITHUB_SHA" \
1313
--output=type=image,push=true \
14-
-t ${DOCKER_IMAGE_ORG_AND_NAME}:$1 .
14+
-t ${DOCKER_IMAGE_ORG_AND_NAME}:$1 \
15+
-f Dockerfile${IS_DEBIAN:+.debian} .
16+
1517
}
1618
push_ghcr() {
1719
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm \
1820
--build-arg VERSION=${TAG} \
1921
--output=type=image,push=true \
20-
-t ghcr.io/$(echo $DOCKER_IMAGE_ORG_AND_NAME | sed 's/pactfoundation/pact-foundation/g'):$1 .
22+
-t ghcr.io/$(echo $DOCKER_IMAGE_ORG_AND_NAME | sed 's/pactfoundation/pact-foundation/g'):$1 \
23+
-f Dockerfile${IS_DEBIAN:+.debian} .
2124
}
2225

2326
if [ -n "${MAJOR_TAG:-}" ]; then
24-
push ${MAJOR_TAG}
25-
push_ghcr ${MAJOR_TAG}
27+
push ${MAJOR_TAG}${DEBIAN}
28+
push_ghcr ${MAJOR_TAG}${DEBIAN}
2629
fi
2730

28-
push ${TAG}
29-
push_ghcr ${TAG}
30-
31+
push ${TAG}${DEBIAN}
32+
push_ghcr ${TAG}${DEBIAN}
3133
if [ "${PUSH_TO_LATEST}" != "false" ]; then
32-
push latest
33-
push_ghcr latest
34+
push latest${DEBIAN}
35+
push_ghcr latest${DEBIAN}
3436
fi

script/release-workflow/docker-scan.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ set -euo >/dev/null
55
script_dir=$(cd "$(dirname $0)" && pwd)
66

77
ARCH=${ARCH:-'amd64'}
8-
DEBIAN=${IS_DEBIAN:+"-debian"}
9-
${script_dir}/../scan.sh ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${ARCH}${DEBIAN}
8+
${script_dir}/../scan.sh ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${ARCH}${IS_DEBIAN:+"-debian"}

script/release-workflow/image-scan.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ set -euo >/dev/null
55
script_dir=$(cd "$(dirname $0)" && pwd)
66

77
ARCH=${ARCH:-'amd64'}
8-
IS_DEBIAN=${IS_DEBIAN:+"-debian"}
9-
trivy image ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${ARCH}${IS_DEBIAN} --severity HIGH,CRITICAL --exit-code 1 --ignorefile ${script_dir}/../.trivyignore
8+
trivy image ${DOCKER_IMAGE_ORG_AND_NAME}:latest-${ARCH}${IS_DEBIAN:+"-debian"} --severity HIGH,CRITICAL --exit-code 1 --ignorefile ${script_dir}/../.trivyignore

script/release-workflow/run.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22

33
set -euo >/dev/null
4+
: "${IS_DEBIAN:=}"
45

56
workflow_dir=$(cd "$(dirname $0)" && pwd)
67

@@ -15,6 +16,13 @@ ${workflow_dir}/validate.sh
1516
${workflow_dir}/docker-prepare.sh
1617
${workflow_dir}/docker-build.sh
1718
${workflow_dir}/docker-scan.sh
18-
${workflow_dir}/prepare-release.sh
19+
20+
# skip release prep and git push on the debian workflow to avoid
21+
# overwriting
22+
if [ -z "${IS_DEBIAN}" ]; then
23+
${workflow_dir}/prepare-release.sh
24+
fi
1925
${workflow_dir}/docker-push.sh
20-
${workflow_dir}/git-push.sh
26+
if [ -z "${IS_DEBIAN}" ]; then
27+
${workflow_dir}/git-push.sh
28+
fi

script/release-workflow/set-env-vars.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ else
1515
export ARCH=amd64
1616
fi
1717

18+
: "${IS_DEBIAN:=}"
19+
export IS_DEBIAN=$IS_DEBIAN
20+
export DEBIAN=${IS_DEBIAN:+"-debian"}
21+
echo "IS_DEBIAN=$IS_DEBIAN"
22+
1823
if [ -z "$TAG" ]; then
1924
if [ -n "$VERSION" ] && [ -z "$INCREMENT" ]; then
2025
echo "If VERSION is specified, then INCREMENT must also be specified"
@@ -27,11 +32,9 @@ if [ -z "$TAG" ]; then
2732
export VERSION=$(bundle exec bump show-next $INCREMENT)
2833
fi
2934

30-
DEBIAN=${IS_DEBIAN:+"-debian"}
31-
3235
export PACT_BROKER_VERSION=$(grep "pact_broker (" pact_broker/Gemfile.lock | awk -F '[()]' '{print $2}')
33-
export TAG="$VERSION-pactbroker${PACT_BROKER_VERSION}${DEBIAN}"
34-
export MAJOR_TAG="$(echo $VERSION | cut -d'.' -f1)${DEBIAN}"
36+
export TAG="$VERSION-pactbroker${PACT_BROKER_VERSION}"
37+
export MAJOR_TAG="$(echo $VERSION | cut -d'.' -f1)"
3538

3639
echo "INCREMENT=$INCREMENT"
3740
echo "VERSION=$VERSION"

script/scan-inside-docker-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
set -eu
33

44
wget -q -O - https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh -s -- -b /usr/local/bin
5-
trivy filesystem --exit-code 1 --no-progress /
5+
trivy filesystem --exit-code 1 --severity HIGH,CRITICAL --no-progress /

script/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44

55
: "${TAG:?TAG must be provided}"
6+
: "${IS_DEBIAN:=}"
67
DEBIAN=${IS_DEBIAN:+"-debian"}
78

89
docker_compose_files=$(find . -name "docker-compose-test*.yml")

0 commit comments

Comments
 (0)