summaryrefslogtreecommitdiffstats
path: root/hack/build-images.sh
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-06-22 15:26:05 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-06-22 15:26:05 -0400
commit3e5dff06fc72f5ef1c4b65d64ec443335c40f795 (patch)
tree0a23d09eee0aaf8b49bbbc73c06a4032cad0bfb9 /hack/build-images.sh
parentea79d8b9efe03e06640cffe8b7e03580a3832c3a (diff)
downloadopenshift-3e5dff06fc72f5ef1c4b65d64ec443335c40f795.tar.gz
openshift-3e5dff06fc72f5ef1c4b65d64ec443335c40f795.tar.bz2
openshift-3e5dff06fc72f5ef1c4b65d64ec443335c40f795.tar.xz
openshift-3e5dff06fc72f5ef1c4b65d64ec443335c40f795.zip
releases: enable build/push with multiple tags
Diffstat (limited to 'hack/build-images.sh')
-rwxr-xr-xhack/build-images.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/hack/build-images.sh b/hack/build-images.sh
index ce421178f..6e6d360bf 100755
--- a/hack/build-images.sh
+++ b/hack/build-images.sh
@@ -47,7 +47,7 @@ if [ "$help" = true ]; then
echo " default: openshift/origin-ansible"
echo
echo " --version=VERSION"
- echo " The version used to tag the image"
+ echo " The version used to tag the image (can be a comma-separated list)"
echo " default: latest"
echo
echo " --no-cache"
@@ -62,25 +62,33 @@ if [ "$help" = true ]; then
exit 0
fi
+
if [ "$verbose" = true ]; then
set -x
fi
BUILD_STARTTIME=$(date +%s)
comp_path=$source_root/
-docker_tag=${prefix}:${version}
+
+# turn comma-separated versions into -t args for docker build
+IFS=',' read -r -a version_arr <<< "$version"
+docker_tags=()
+for tag in "${version_arr[@]}"; do
+ docker_tags+=("-t" "${prefix}:${tag}")
+done
+
echo
echo
-echo "--- Building component '$comp_path' with docker tag '$docker_tag' ---"
-docker build ${options} -t $docker_tag $comp_path
-BUILD_ENDTIME=$(date +%s); echo "--- $docker_tag took $(($BUILD_ENDTIME - $BUILD_STARTTIME)) seconds ---"
+echo "--- Building component '$comp_path' with docker tag(s) '$version' ---"
+docker build ${options} "${docker_tags[@]}" $comp_path
+BUILD_ENDTIME=$(date +%s); echo "--- ${version} took $(($BUILD_ENDTIME - $BUILD_STARTTIME)) seconds ---"
echo
echo
echo
echo
echo "++ Active images"
-docker images | grep ${prefix} | grep ${version} | sort
+docker images | grep ${prefix} | sort
echo