try matrix builds

This commit is contained in:
Evan Jarrett
2026-04-03 20:10:29 -05:00
parent fd5bfc3c50
commit c77a180b63
+47 -11
View File
@@ -1,5 +1,5 @@
# ATCR Release Pipeline for Tangled.org
# Triggers on version tags and builds cross-platform binaries using buildah
# Builds multi-arch container images (amd64 + arm64) and creates manifest lists
when:
- event: ["push"]
@@ -7,7 +7,7 @@ when:
engine: kubernetes
image: quay.io/buildah/stable:latest
architecture: amd64
architecture: [amd64, arm64]
environment:
IMAGE_REGISTRY: atcr.io
@@ -23,22 +23,58 @@ steps:
- name: Build and push AppView image
command: |
TAG="${IMAGE_REGISTRY}/${IMAGE_USER}/appview:${TANGLED_REF_NAME}-${TANGLED_ARCHITECTURE}"
buildah bud \
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/appview:${TANGLED_REF_NAME} \
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/appview:latest \
--tag "${TAG}" \
--file ./Dockerfile.appview \
.
buildah push \
${IMAGE_REGISTRY}/${IMAGE_USER}/appview:latest
buildah push "${TAG}"
mkdir -p /artifacts
echo "${TAG}" > /artifacts/appview.txt
- name: Build and push Hold image
command: |
TAG="${IMAGE_REGISTRY}/${IMAGE_USER}/hold:${TANGLED_REF_NAME}-${TANGLED_ARCHITECTURE}"
buildah bud \
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/hold:${TANGLED_REF_NAME} \
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/hold:latest \
--tag "${TAG}" \
--file ./Dockerfile.hold \
.
buildah push "${TAG}"
echo "${TAG}" > /artifacts/hold.txt
buildah push \
${IMAGE_REGISTRY}/${IMAGE_USER}/hold:latest
- name: Build and push Scanner image
command: |
TAG="${IMAGE_REGISTRY}/${IMAGE_USER}/scanner:${TANGLED_REF_NAME}-${TANGLED_ARCHITECTURE}"
buildah bud \
--tag "${TAG}" \
--file ./Dockerfile.scanner \
.
buildah push "${TAG}"
echo "${TAG}" > /artifacts/scanner.txt
final:
architecture: amd64
image: quay.io/buildah/stable:latest
steps:
- name: Login to registry
command: |
echo "${APP_PASSWORD}" | buildah login \
-u "${IMAGE_USER}" \
--password-stdin \
${IMAGE_REGISTRY}
- name: Create and push multi-arch manifests
command: |
for IMAGE in appview hold scanner; do
FULL="${IMAGE_REGISTRY}/${IMAGE_USER}/${IMAGE}"
AMD64_TAG=$(cat /artifacts/amd64/${IMAGE}.txt)
ARM64_TAG=$(cat /artifacts/arm64/${IMAGE}.txt)
buildah manifest create "${FULL}:${TANGLED_REF_NAME}"
buildah manifest add "${FULL}:${TANGLED_REF_NAME}" "docker://${AMD64_TAG}"
buildah manifest add "${FULL}:${TANGLED_REF_NAME}" "docker://${ARM64_TAG}"
buildah manifest push --all "${FULL}:${TANGLED_REF_NAME}" "docker://${FULL}:${TANGLED_REF_NAME}"
buildah manifest push --all "${FULL}:${TANGLED_REF_NAME}" "docker://${FULL}:latest"
done