Change Image

Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
This commit is contained in:
Patrick Niebeling
2022-02-28 23:10:40 +01:00
parent 6ffbdcd7d4
commit 3ca96a7270
21 changed files with 257 additions and 669 deletions

13
Experimental/hooks/build Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# hooks/build
# https://docs.docker.com/docker-cloud/builds/advanced/
# $IMAGE_NAME var is injected into the build so the tag is correct.
echo "[***] Build hook running"
docker build \
--build-arg VERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\(.*\)\~git.*\~.*.dsc\".*/\1/p" | tail -1) \
--build-arg COMMIT=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_.*\~git.*\~\(.*\)\~.*.dsc\".*/\1/p" | tail -1) \
--build-arg BRANCH=$(git rev-parse --abbrev-ref HEAD) \
--build-arg DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $IMAGE_NAME .

View File

@ -0,0 +1,11 @@
#!/bin/bash
#VERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\([0-9]\{1\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}\)-[0-9]\{1,2\}~git.*\~.*.dsc\".*/\1/p" | tail -1)
#MVERSION=${VERSION%.*}
MVERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\(.*\)\~git.*\~.*.dsc\".*/\1/p" | tail -1)
docker tag \
"${IMAGE_NAME}" \
"${DOCKER_REPO}:experimental-${MVERSION}"
docker push \
"${DOCKER_REPO}:experimental-${MVERSION}"