Optionally set docker-tag to stream 63/65163/1
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Fri, 21 Aug 2020 16:45:15 +0000 (09:45 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Fri, 21 Aug 2020 16:46:28 +0000 (09:46 -0700)
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 <jwagantall@linuxfoundation.org>
Change-Id: Ib595b6bf9439a45985cc41233f588cb0e56b7920

docs/jjb/lf-docker-jobs.rst
releasenotes/notes/docker-get-tag-stream-a2038d32f2c76738.yaml [new file with mode: 0644]
shell/docker-get-container-tag.sh

index a7351bb..efe6674 100644 (file)
@@ -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 (file)
index 0000000..fe0e146
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Optionally get docker container tag to be set to the value of *stream*.
index df3f8ce..f3beff0 100644 (file)
@@ -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