From 92b6d74ea14c58b0372f763a267ff64fd8b85a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 15 Aug 2024 11:12:08 +0300 Subject: [PATCH] Move to Woodpecker --- .drone.yml | 2 -- .gitignore | 1 + .woodpecker/build.yaml | 26 ++++++++++++++++++++++++++ .woodpecker/manifest.yaml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 2 +- 5 files changed, 59 insertions(+), 3 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker/build.yaml create mode 100644 .woodpecker/manifest.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e7b5dfa..0000000 --- a/.drone.yml +++ /dev/null @@ -1,2 +0,0 @@ -kind: template -load: docker.yaml diff --git a/.gitignore b/.gitignore index 4c49bd7..54755c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .env +*.save diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..728bb00 --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,26 @@ +--- +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 diff --git a/.woodpecker/manifest.yaml b/.woodpecker/manifest.yaml new file mode 100644 index 0000000..0c83338 --- /dev/null +++ b/.woodpecker/manifest.yaml @@ -0,0 +1,31 @@ +--- +skip_clone: true + +steps: + - name: manifest + image: mirror.gcr.io/mplatform/manifest-tool:alpine-v2.1.6 + secrets: + - docker_username + - docker_password + commands: + - set -u + - ls -lash + - env + - | + 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 + +depends_on: + - build diff --git a/Dockerfile b/Dockerfile index 16ebe31..26122e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM mirror.gcr.io/library/ubuntu:focal WORKDIR /app ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \