From 59e4bff9eaeb77cab2dcf51b099f0726587f77fa Mon Sep 17 00:00:00 2001 From: DCsunset Date: Sun, 2 Feb 2020 18:29:31 -0800 Subject: [PATCH] feat: add hooks to build different versions --- hooks/build | 13 +++++++++++++ hooks/push | 13 +++++++++++++ versions.txt | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 hooks/build create mode 100644 hooks/push create mode 100644 versions.txt diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..38f890d --- /dev/null +++ b/hooks/build @@ -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 diff --git a/hooks/push b/hooks/push new file mode 100644 index 0000000..71bcdd9 --- /dev/null +++ b/hooks/push @@ -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 \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 0000000..3eb6ac4 --- /dev/null +++ b/versions.txt @@ -0,0 +1,3 @@ +latest +18:04 +16.04