Improve docker build to use hooks

This commit is contained in:
Frédéric Guillot
2017-11-30 16:47:52 -08:00
parent 12202f0451
commit 55547db6ce
16 changed files with 161 additions and 20 deletions

15
hooks/build Executable file
View File

@@ -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 .