From 4dc067cec0229ff02540163a9fe0f3b0a5dfa4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Tue, 20 Aug 2024 12:47:18 +0300 Subject: [PATCH] Initial commit --- README.md | 9 +++++++++ build.yaml | 28 ++++++++++++++++++++++++++++ manifest.yaml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 README.md create mode 100644 build.yaml create mode 100644 manifest.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..a050c5d --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Multiarch Docker image build pipeline + +Include this repository as `.woodpecker` submodule in your Git repository + +This pipeline follows some patterns: + +* All images are built multiarch amd64 and arm64 both +* Image names are consistently mapped between Git repo and Harbor, so + git.k-space.ee/foo/bar becomes harbor.k-space.ee/foo/bar diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..3d43473 --- /dev/null +++ b/build.yaml @@ -0,0 +1,28 @@ +--- +matrix: + ARCH: + - amd64 + - arm64 + +steps: + - name: build + image: woodpeckerci/plugin-kaniko + backend_options: + kubernetes: + nodeSelector: + kubernetes.io/arch: ${ARCH} + tolerations: + - key: arch + operator: Equal + value: ${ARCH} + effect: NoSchedule + settings: + repo: ${CI_REPO} + registry: harbor.k-space.ee + tags: latest-${ARCH} + username: + from_secret: docker_username + password: + from_secret: docker_password + when: + - branch: master diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 0000000..3b74221 --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,30 @@ +--- +skip_clone: true + +steps: + - name: manifest + image: mirror.gcr.io/mplatform/manifest-tool:alpine-v2.1.6 + secrets: + - docker_username + - docker_password + commands: + - | + cat << EOF > spec.yaml + image: "harbor.k-space.ee/${CI_REPO}:latest" + manifests: + - image: "harbor.k-space.ee/${CI_REPO}:latest-amd64" + platform: + architecture: amd64 + os: linux + - image: "harbor.k-space.ee/${CI_REPO}:latest-arm64" + platform: + architecture: arm64 + os: linux + EOF + - /manifest-tool --username $docker_username --password $docker_password push from-spec spec.yaml > stdout + - cat stdout + when: + - branch: master + +depends_on: + - build