From: Anil Belur Date: Tue, 9 Aug 2022 08:27:51 +0000 (+1000) Subject: Chore: Fix bashate warnings X-Git-Tag: v0.79.4~2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F70468%2F3;p=releng%2Fglobal-jjb.git Chore: Fix bashate warnings ./shell/common-variables.sh:21:1: E006 Line too long ./shell/common-variables.sh:26:1: E006 Line too long ./shell/docker-build.sh:20:1: E006 Line too long ./shell/docker-login.sh:50:1: E006 Line too long ./shell/docker-push.sh:18:1: E006 Line too long ./shell/gerrit-branch-lock.sh:49:1: E006 Line too long ./shell/gerrit-branch-lock.sh:50:1: E006 Line too long ./shell/gerrit-branch-lock.sh:56:1: E006 Line too long Issue-ID: RELENG-4358 Change-Id: I37198320bc512f2c75c47346e991ea0f0a182fab Signed-off-by: Anil Belur --- diff --git a/shell/common-variables.sh b/shell/common-variables.sh index 5092a8ea..be0a4512 100644 --- a/shell/common-variables.sh +++ b/shell/common-variables.sh @@ -16,14 +16,16 @@ echo "---> common-variables.sh" MAVEN_OPTIONS="$(echo --show-version \ --batch-mode \ -Djenkins \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer"\ +".Slf4jMavenTransferListener=warn" \ -Dmaven.repo.local=/tmp/r \ -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)" echo "$MAVEN_OPTIONS" # Activates the lftools virtualenv lftools_activate() { - echo "WARNING: lftools_activate should no longer be used and will be removed in a future release." + echo "WARNING: lftools_activate should no longer be used"\ + "and will be removed in a future release." virtualenv --quiet "/tmp/v/lftools" set +u # Ignore unbound variables in activate # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 diff --git a/shell/docker-build.sh b/shell/docker-build.sh index 0e8b709d..c5a1292e 100644 --- a/shell/docker-build.sh +++ b/shell/docker-build.sh @@ -15,9 +15,11 @@ set -eu -o pipefail 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" ." +# 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 d172a3b2..97e030b3 100644 --- a/shell/docker-login.sh +++ b/shell/docker-login.sh @@ -46,8 +46,10 @@ echo "---> docker-login.sh" # Ensure we fail the job if any steps fail set -eu -o pipefail -#Check if current version less than desired version -version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +# Check if current version less than desired version +version_lt() { + test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; +} # Execute the credential lookup and set set_creds() { diff --git a/shell/docker-push.sh b/shell/docker-push.sh index 340bc2db..9348e8cd 100644 --- a/shell/docker-push.sh +++ b/shell/docker-push.sh @@ -15,7 +15,8 @@ echo "---> docker-push.sh" set -ue -o pipefail 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"" +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/gerrit-branch-lock.sh b/shell/gerrit-branch-lock.sh index 60f28fe2..88f5a22f 100644 --- a/shell/gerrit-branch-lock.sh +++ b/shell/gerrit-branch-lock.sh @@ -46,14 +46,19 @@ mode=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep branch | awk '{print $1}') case $mode in lock) echo "Locking branch: $GERRIT_BRANCH" - git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.exclusiveGroupPermissions" "submit" - git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.submit" "block group Registered Users" + git config -f project.config \ + "access.refs/heads/${GERRIT_BRANCH}.exclusiveGroupPermissions" \ + "submit" + git config -f project.config \ + "access.refs/heads/${GERRIT_BRANCH}.submit" \ + "block group Registered Users" git commit -asm "Lock branch $GERRIT_BRANCH" ;; unlock) echo "Unlocking branch: $GERRIT_BRANCH" - git config -f project.config --remove-section "access.refs/heads/${GERRIT_BRANCH}" || true + git config -f project.config --remove-section \ + "access.refs/heads/${GERRIT_BRANCH}" || true git commit -asm "Unlock branch $GERRIT_BRANCH" ;;