From 3fc22bf078319ab5499cd37946ceb16fd53901b9 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sun, 23 Jan 2022 10:53:58 +0100 Subject: [PATCH] Switchd to hyper-minimal docker image --- .woodpecker/.image.yml | 2 ++ .woodpecker/.publish.yml | 3 +++ .woodpecker/.release.yml | 1 + Dockerfile.ci | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 Dockerfile.ci diff --git a/.woodpecker/.image.yml b/.woodpecker/.image.yml index 7f583a8a..dcf40f97 100644 --- a/.woodpecker/.image.yml +++ b/.woodpecker/.image.yml @@ -2,12 +2,14 @@ # because it has to be the target of the pull request branches: dev platform: linux/amd64 +depends_on: build pipeline: dryrun: image: woodpeckerci/plugin-docker-buildx secrets: [ docker_username, docker_password ] settings: + dockerfile: Dockerfile.ci repo: chewingbever/vieter tag: dev platforms: [ linux/arm/v7, linux/arm64/v8, linux/amd64 ] diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index 9e5f39a3..1e70eaff 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -6,9 +6,12 @@ pipeline: image: woodpeckerci/plugin-docker-buildx secrets: [ docker_username, docker_password ] settings: + dockerfile: Dockerfile.ci repo: chewingbever/vieter tag: dev platforms: [ linux/arm/v7, linux/arm64/v8, linux/amd64 ] + args: + - CI_COMMIT_SHA when: event: push branch: dev diff --git a/.woodpecker/.release.yml b/.woodpecker/.release.yml index bc43b900..a220c75a 100644 --- a/.woodpecker/.release.yml +++ b/.woodpecker/.release.yml @@ -1,6 +1,7 @@ # Yeah so this only works on tags so we'll worry about this later platform: linux/amd64 branches: main +depends_on: build # We need the entire repo in order for the release names to work skip_clone: true diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 00000000..387d2efa --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,20 @@ +# vim: ft=dockerfile +# This image just has the required tools to download the binaries +FROM chewingbever/vlang:latest AS builder + +ARG TARGETPLATFORM +ARG CI_COMMIT_SHA + +WORKDIR /app + +RUN curl \ + -o vieter \ + "https://s3.rustybever.be/vieter/commits/${CI_COMMIT_SHA}/vieter-$(echo "${TARGETPLATFORM}" | sed 's:/:-:g')" && \ + chmod +x vieter + + +FROM scratch + +COPY --from=builder /app/vieter /bin/vieter + +ENTRYPOINT ["/bin/vieter"]