From 1c5959938700454ad2503706d098eb2199767083 Mon Sep 17 00:00:00 2001 From: sdarwin Date: Tue, 28 Jun 2022 09:25:56 -0600 Subject: [PATCH] Add support for s390x architecture --- .drone.yml | 33 +++++++++++++++++++++++++++++++++ docker/Dockerfile.linux.amd64 | 2 +- docker/Dockerfile.linux.s390x | 11 +++++++++++ docker/manifest.tmpl | 7 ++++++- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 docker/Dockerfile.linux.s390x diff --git a/.drone.yml b/.drone.yml index 10262fd..59d56c7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -99,6 +99,38 @@ steps: - push - tag +--- +kind: pipeline +type: vm +name: linux-s390x + +pool: + use: ubuntu-20.04 + +steps: +- name: publish + commands: + - apt-get update + - apt-get install -y jq + - mkdir -p ~/.docker/cli-plugins + - export BUILDX_URL=$(curl https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.assets[].browser_download_url' | grep linux-amd64) + - wget $BUILDX_URL -O ~/.docker/cli-plugins/docker-buildx + - chmod +x ~/.docker/cli-plugins/docker-buildx + - ls -al ~/.docker/cli-plugins/ + - apt-get install -y binfmt-support qemu-user-static + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - docker login -u $USERNAME -p $PASSWORD + - docker buildx build --rm=true -f docker/Dockerfile.linux.s390x . --push --pull=true --platform linux/s390x -t drone/git:linux-s390x + environment: + PASSWORD: + from_secret: docker_password + USERNAME: + from_secret: docker_username + when: + event: + - push + - tag + --- kind: pipeline type: ssh @@ -221,6 +253,7 @@ depends_on: - linux-amd64 - linux-arm64 - linux-arm +- linux-s390x - windows-1909-amd64 - windows-1903-amd64 - windows-1809-amd64 diff --git a/docker/Dockerfile.linux.amd64 b/docker/Dockerfile.linux.amd64 index 76d96ad..604ca1d 100644 --- a/docker/Dockerfile.linux.amd64 +++ b/docker/Dockerfile.linux.amd64 @@ -8,4 +8,4 @@ ADD posix/* /usr/local/bin/ # USER drone:drone # RUN chmod -R 777 /home/drone -ENTRYPOINT ["/usr/local/bin/clone"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.s390x b/docker/Dockerfile.linux.s390x new file mode 100644 index 0000000..604ca1d --- /dev/null +++ b/docker/Dockerfile.linux.s390x @@ -0,0 +1,11 @@ +FROM alpine:3.12 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl aws-cli sudo + +ADD posix/* /usr/local/bin/ + +# RUN adduser -g Drone -s /bin/sh -D -u 1000 drone +# RUN echo 'drone ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/drone +# USER drone:drone +# RUN chmod -R 777 /home/drone + +ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 7a8ab73..776c4b3 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -17,6 +17,11 @@ manifests: variant: v8 architecture: arm64 os: linux + - + image: drone/git:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-s390x + platform: + architecture: s390x + os: linux - image: drone/git:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: @@ -52,4 +57,4 @@ manifests: platform: architecture: amd64 os: windows - version: 1909 \ No newline at end of file + version: 1909