From: Jessica Wagantall Date: Fri, 21 Aug 2020 16:45:15 +0000 (-0700) Subject: Optionally set docker-tag to stream X-Git-Tag: v0.57.0~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=33e49c57ff646e8bad3d033ee770df88d8051f73;p=releng%2Fglobal-jjb.git Optionally set docker-tag to stream If container-tag-method: stream, docker jobs will use the value of the variable stream as docker tag. Issue: IT-20480 Signed-off-by: Jessica Wagantall Change-Id: Ib595b6bf9439a45985cc41233f588cb0e56b7920 --- diff --git a/docs/jjb/lf-docker-jobs.rst b/docs/jjb/lf-docker-jobs.rst index a7351bb5..efe66745 100644 --- a/docs/jjb/lf-docker-jobs.rst +++ b/docs/jjb/lf-docker-jobs.rst @@ -25,6 +25,8 @@ docker-get-container-tag.sh. Use one of the following methods: If ``container-tag-method: latest``, uses the literal string ``latest``. +If ``container-tag-method: stream``, uses the value of the variable ``stream``. + If ``container-tag-method: git-describe``, reads the tag from the ``git describe`` command on the repository, which requires that the repository has a git tag. For example, if the most recent tag is 'v0.48.1', this diff --git a/releasenotes/notes/docker-get-tag-stream-a2038d32f2c76738.yaml b/releasenotes/notes/docker-get-tag-stream-a2038d32f2c76738.yaml new file mode 100644 index 00000000..fe0e1464 --- /dev/null +++ b/releasenotes/notes/docker-get-tag-stream-a2038d32f2c76738.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Optionally get docker container tag to be set to the value of *stream*. diff --git a/shell/docker-get-container-tag.sh b/shell/docker-get-container-tag.sh index df3f8ce4..f3beff0e 100644 --- a/shell/docker-get-container-tag.sh +++ b/shell/docker-get-container-tag.sh @@ -21,6 +21,8 @@ set -feu -o pipefail tag="" if [[ $CONTAINER_TAG_METHOD == "latest" ]]; then tag="latest" +elif [[ $CONTAINER_TAG_METHOD == "stream" ]]; then + tag="$STREAM" elif [[ $CONTAINER_TAG_METHOD == "git-describe" ]]; then tag=$(git describe) elif [[ $CONTAINER_TAG_METHOD == "yaml-file" ]]; then