diff options
author | Micah Anderson <micah@riseup.net> | 2024-02-05 22:13:17 -0500 |
---|---|---|
committer | micah <micah@torproject.org> | 2024-03-03 14:07:33 +0000 |
commit | 5ee90a78b40057e0716f1fdb098a7156d22786de (patch) | |
tree | dcd577558ea6b767d63ed0556d8a79c09a4ce572 | |
parent | 9175e86321bdb8f885063791c93b441a479b1308 (diff) | |
download | snowflake-5ee90a78b40057e0716f1fdb098a7156d22786de.tar.gz snowflake-5ee90a78b40057e0716f1fdb098a7156d22786de.zip |
Build multi-arch image.
This will build only those architectures that we have runners to build on
-rw-r--r-- | .gitlab-ci.yml | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24a4ac8..83929ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,7 @@ +stages: + - test + - deploy + - container-build variables: DEBIAN_FRONTEND: noninteractive @@ -275,14 +279,45 @@ release-job: url: '${CI_PROJECT_URL}/-/jobs/${TAR_JOB_ID}/artifacts/file/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz' build-container: - stage: deploy + variables: + TAG: latest + stage: container-build + parallel: + matrix: + - ARCH: amd64 + - ARCH: arm64 + - ARCH: s390x + tags: + - $ARCH image: - name: gcr.io/kaniko-project/executor:v1.14.0-debug + name: gcr.io/kaniko-project/executor:debug entrypoint: [""] script: - - /kaniko/executor + - if [ -n "$CI_COMMIT_TAG" ]; then TAG="$CI_COMMIT_TAG"; fi + - >- + /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" - --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}" - rules: - - if: $CI_COMMIT_TAG + --destination "${CI_REGISTRY_IMAGE}:${TAG}_${ARCH}" + +merge-manifests: + variables: + TAG: latest + stage: container-build + needs: + - job: build-container + artifacts: false + image: + name: mplatform/manifest-tool:alpine + entrypoint: [""] + script: + - if [ -n "$CI_COMMIT_TAG" ]; then export TAG="$CI_COMMIT_TAG"; fi + - >- + manifest-tool + --username="${CI_REGISTRY_USER}" + --password="${CI_REGISTRY_PASSWORD}" + push from-args + --platforms linux/amd64,linux/arm64,linux/s390x + --template "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}_ARCH" + --target "${CI_REGISTRY_IMAGE}:${TAG}" + |