From 425b712e940bbb8857a32ef53eeb1fbfb65603d3 Mon Sep 17 00:00:00 2001 From: Jason Kendall Date: Thu, 30 Jan 2020 10:05:56 -0500 Subject: [PATCH] DockerHub build hooks --- modules/hooks/build | 13 +++++++++++++ server/hooks/build | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/hooks/build create mode 100644 server/hooks/build diff --git a/modules/hooks/build b/modules/hooks/build new file mode 100644 index 0000000..c31fd2a --- /dev/null +++ b/modules/hooks/build @@ -0,0 +1,13 @@ +#!/bin/bash +# 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" + +export $(grep -v '^#' ../.env | xargs) + +docker build \ + --build-arg BUILD_RFC3339=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --build-arg COMMIT=$(git rev-parse --short HEAD) \ + --build-arg VERSION=$(git describe --tags --always) \ + -t $IMAGE_NAME . diff --git a/server/hooks/build b/server/hooks/build new file mode 100644 index 0000000..c31fd2a --- /dev/null +++ b/server/hooks/build @@ -0,0 +1,13 @@ +#!/bin/bash +# 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" + +export $(grep -v '^#' ../.env | xargs) + +docker build \ + --build-arg BUILD_RFC3339=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ + --build-arg COMMIT=$(git rev-parse --short HEAD) \ + --build-arg VERSION=$(git describe --tags --always) \ + -t $IMAGE_NAME .