feat: add hooks to build different versions

This commit is contained in:
DCsunset 2020-02-02 18:29:31 -08:00
parent 047564e162
commit 59e4bff9ea
3 changed files with 29 additions and 0 deletions

13
hooks/build Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# original docker build command
echo "overwriting docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME ."
cat "../versions.txt" | while read VERSION
do
# The new image tag will include the version of ubuntu
IMAGE_TAG="${DOCKER_REPO}:${VERSION}"
echo "docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} ."
docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} .
done

13
hooks/push Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# original docker push command
echo "overwriting docker push $IMAGE_NAME"
cat "../versions.txt" | while read VERSION
do
# The new image tag will include the version of ubuntu
IMAGE_TAG="${DOCKER_REPO}:${VERSION}"
echo "docker push ${IMAGE_TAG}"
docker push ${IMAGE_TAG}
done

3
versions.txt Normal file
View file

@ -0,0 +1,3 @@
latest
18:04
16.04