summaryrefslogtreecommitdiff
path: root/hooks/build
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2017-11-30 16:47:52 -0800
committerFrédéric Guillot <fred@kanboard.net>2017-11-30 16:55:53 -0800
commit55547db6ce691a71d19a502178c2a9e00a303dd5 (patch)
tree41197ca843b9b0d5f47e6b22e5bcc00a4aa37b68 /hooks/build
parent12202f04511c14844641edce879afd81e10e767b (diff)
Improve docker build to use hooks
Diffstat (limited to 'hooks/build')
-rwxr-xr-xhooks/build15
1 files changed, 15 insertions, 0 deletions
diff --git a/hooks/build b/hooks/build
new file mode 100755
index 00000000..043be1f7
--- /dev/null
+++ b/hooks/build
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+VERSION=master
+
+if [ "$SOURCE_BRANCH" != "" ]; then
+ VERSION=$SOURCE_BRANCH
+
+ if [ "$SOURCE_BRANCH" == "latest" ]; then
+ VERSION=master
+ fi
+fi
+
+echo "Building $VERSION"
+
+docker build --build-arg VERSION=$VERSION -t $IMAGE_NAME .