From 90b64c2e68dce5981197297137d818f6b751fe27 Mon Sep 17 00:00:00 2001 From: Michael Gibson Date: Thu, 28 May 2020 12:24:58 -0500 Subject: [PATCH] Added support for building image based on tag. --- .drone.yml | 32 ++++++++++++++++++++++++++++++-- Dockerfile | 9 ++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 29885c3..d632b85 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ type: docker name: default steps: - - name: docker + - name: build image: plugins/docker settings: registry: registry.thegibsonhome.net @@ -13,4 +13,32 @@ steps: password: from_secret: registry_password repo: registry.thegibsonhome.net/protonmail-bridge - autotag: true + tags: + - latest +trigger: + branch: + - master + event: + - push + +--- +kind: pipeline +type: docker +name: tag + +steps: + - name: build + image: plugins/docker + environment: + TAG: ${DRONE_TAG} + settings: + registry: registry.thegibsonhome.net + username: + from_secret: registry_username + password: + from_secret: registry_password + repo: registry.thegibsonhome.net/protonmail-bridge + tags: ${DRONE_COMMIT} +trigger: + event: + - tag \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 55d473a..b89a778 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,12 @@ RUN apk add --no-cache \ make \ musl-dev WORKDIR /usr/src -RUN git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge -WORKDIR /usr/src/proton-bridge -RUN make build-nogui + +ARG TAG +RUN git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge \ + && cd proton-bridge \ + && if [ -n "$TAG" ]; then git checkout tags/$TAG; fi \ + && make build-nogui # Create a container for the ProtonMail Bridge. FROM alpine:edge