From: Lott, Christopher (cl778h) Date: Wed, 29 Apr 2020 17:58:30 +0000 (-0400) Subject: Report CLI version in scripts that invoke docker X-Git-Tag: v0.54.0~2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=0c2d2eea337b2700a7913d03aa5afd75d0c11b93;p=releng%2Fglobal-jjb.git Report CLI version in scripts that invoke docker Extend scripts that invoke the docker CLI to report the version by invoking `docker --version`. Also add echo command to report end of script where it was missing. Includes docker-build.sh, docker-login.sh, docker-push.sh and release-job.sh. No functional change to any script behavior, just a line of extra output. Change-Id: Iac65366c7810d6f96fecb84267aa4c1dd9027dc1 Signed-off-by: Lott, Christopher (cl778h) --- diff --git a/releasenotes/notes/show-docker-version-d8f6f22243127194.yaml b/releasenotes/notes/show-docker-version-d8f6f22243127194.yaml new file mode 100644 index 00000000..7b9c6b88 --- /dev/null +++ b/releasenotes/notes/show-docker-version-d8f6f22243127194.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Extend scripts that invoke the docker CLI to report the version + by invoking `docker --version`. Also add echo command to report + end of script where it was missing. Includes docker-build.sh, + docker-login.sh, docker-push.sh and release-job.sh. No functional + change to any script behavior, just a line of extra output. diff --git a/shell/docker-build.sh b/shell/docker-build.sh index 8453dcd1..0e8b709d 100644 --- a/shell/docker-build.sh +++ b/shell/docker-build.sh @@ -12,10 +12,12 @@ echo "---> docker-build.sh" # Docker image build script set -eu -o pipefail -echo "---> Building image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" +docker --version +echo "Building image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" cd "$DOCKER_ROOT" # DOCKER_IMAGE_TAG variable gets constructed after lf-docker-get-container-tag builder step # is executed. It constructs the image name and the appropriate tag in the same varaiable. docker_build_command="docker build ${DOCKER_ARGS:-} -t "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" ." echo "$docker_build_command" eval "$docker_build_command" | tee "$WORKSPACE/docker_build_log.txt" +echo "---> docker-build.sh ends" diff --git a/shell/docker-login.sh b/shell/docker-login.sh index ca4758f4..72d420f3 100644 --- a/shell/docker-login.sh +++ b/shell/docker-login.sh @@ -8,7 +8,6 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## -echo "---> docker-login.sh" # Log into a custom hosted docker registry and / or docker.io # $DOCKER_REGISTRY : Optional @@ -43,7 +42,7 @@ echo "---> docker-login.sh" #2) User logging into docker.io with docker version <17.06.0 email optional #3) User logging into docker.io wiht docker version >= 17.06.0 cannot use email flag - +echo "---> docker-login.sh" # Ensure we fail the job if any steps fail set -eu -o pipefail @@ -117,3 +116,5 @@ then do_login "$DOCKERHUB_REGISTRY" none fi fi + +echo "---> docker-login.sh ends" diff --git a/shell/docker-push.sh b/shell/docker-push.sh index fa30ea03..340bc2db 100644 --- a/shell/docker-push.sh +++ b/shell/docker-push.sh @@ -13,7 +13,9 @@ echo "---> docker-push.sh" # Ensure we fail the job if any steps fail set -ue -o pipefail -echo "---> Pushing image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" +docker --version +echo "Pushing image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" docker_push_command="docker push "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG"" echo "$docker_push_command" eval "$docker_push_command" +echo "---> docker-push.sh ends" diff --git a/shell/release-job.sh b/shell/release-job.sh index 3a0294e5..5276a684 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -335,6 +335,7 @@ nexus_release(){ container_release_file(){ echo "INFO: Processing container release" + docker --version local lfn_umbrella lfn_umbrella="$(echo "$GERRIT_URL" | awk -F"." '{print $2}')"