From d6c9245ed5845f73867f8c89656f6b44f3bc0c14 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 26 Mar 2023 16:13:21 +0200 Subject: [PATCH] feat: Add CD --- .drone.yml | 22 ++++++++++++++++++++++ Dockerfile | 10 +++++----- 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4fbfa12 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,22 @@ +--- +kind: pipeline +type: docker +name: CI + +steps: + - name: docker + image: plugins/docker + settings: + username: phundrak + password: + from_secret: dh_key + repo: phundrak/pleroma + tags: + - latest + platform: linux/amd64 + build_args: | + buildx_argv=( + --pull + --platform amd64 + --tag "phundrak/pleroma:latest" + ) diff --git a/Dockerfile b/Dockerfile index bf2d0a7..e6771d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,17 +6,17 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends unzip # docker buildx will fill this in -ARG TARGETARCH +ARG TARGETARCH # Clone the release build into a temporary directory and unpack it # We use ADD here to bust the cache if the pleroma release changes # We use a separate layer for extraction so we don't end up with junk # from ADD left over in the final image. -ADD https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=${TARGETARCH} /tmp/pleroma.zip +ADD https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=amd64 /tmp/pleroma.zip -RUN mkdir -p /opt/pleroma-${TARGETARCH} && \ +RUN mkdir -p /opt/pleroma-amd64 && \ unzip /tmp/pleroma.zip -d /tmp/ && \ - mv /tmp/release/* /opt/pleroma-${TARGETARCH} + mv /tmp/release/* /opt/pleroma-amd64 # Ok, really build the container now FROM ubuntu:20.04 AS pleroma @@ -43,7 +43,7 @@ RUN mkdir -p /etc/pleroma /var/lib/pleroma/static /var/lib/pleroma/uploads && \ ARG TARGETARCH -COPY --chown=pleroma:pleroma --from=unzip /opt/pleroma-${TARGETARCH}/ /opt/pleroma/ +COPY --chown=pleroma:pleroma --from=unzip /opt/pleroma-amd64/ /opt/pleroma/ VOLUME [ "/etc/pleroma", "/var/lib/pleroma/uploads", "/var/lib/pleroma/static" ]