diff options
author | Guillaume Tucker <guillaume.tucker@collabora.com> | 2019-05-10 08:45:06 +0100 |
---|---|---|
committer | Guillaume Tucker <guillaume.tucker@collabora.com> | 2019-05-10 10:49:25 +0100 |
commit | 344735b8337a93ec4877e17da4be34b22d61cb61 (patch) | |
tree | e9adde099070f3888a141957ce55a6d6cff42dac /jenkins | |
parent | dd1747b4ae595cefbc6fa23b7187fd1d7f4ca170 (diff) |
dockerfiles/build-and-push.sh: replace -h option with -t for tag
Replace the -h option which was to provide the Docker Hub account name
with -t to provide a Docker tag prefix. This essentially does the
same when pushing the tagged images as the beginning of the tag name
gives the account name, but it also fixes the case where a a longer
string prefix is required in the tag i.e. "-t kernelci/staging-".
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins')
-rwxr-xr-x | jenkins/dockerfiles/build-and-push.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jenkins/dockerfiles/build-and-push.sh b/jenkins/dockerfiles/build-and-push.sh index 44278c3..98a89d0 100755 --- a/jenkins/dockerfiles/build-and-push.sh +++ b/jenkins/dockerfiles/build-and-push.sh @@ -24,12 +24,12 @@ # -b = also rebuild build-base # -d = also rebuild debos # -q = make the builds quiet -# -d = the docker namespace/account to build for (default is kernelci) +# -t = the prefix to use in docker tags (default is kernelci/) set -e -dockerhub='kernelci' +tag_px='kernelci/' -options='npbdqh:' +options='npbdqt:' while getopts $options option do case $option in @@ -38,7 +38,7 @@ do b ) base=true;; d ) debos=true;; q ) quiet="--quiet";; - h ) dockerhub=$OPTARG;; + t ) tag_px=$OPTARG;; \? ) echo "Invalid Option: -$OPTARG" 1>&2 exit 1 @@ -62,7 +62,7 @@ echo_push() { if [ "x${base}" == "xtrue" ] then - tag=${dockerhub}/build-base + tag=${tag_px}build-base echo_build $tag docker build ${quiet} ${cache_args} build-base -t $tag if [ "x${push}" == "xtrue" ] @@ -74,7 +74,7 @@ fi for c in {gcc,clang}-* do - tag=${dockerhub}/build-$c + tag=${tag_px}build-$c echo_build $tag docker build ${quiet} ${cache_args} $c -t $tag if [ "x${push}" == "xtrue" ] @@ -86,7 +86,7 @@ done if [ "x${debos}" == "xtrue" ] then - tag=${dockerhub}/debos + tag=${tag_px}debos echo_build $tag docker build ${quiet} ${cache_args} debos -t $tag if [ "x${push}" == "xtrue" ] |