Chore: Fix bashate warnings 68/70468/3
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 9 Aug 2022 08:27:51 +0000 (18:27 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Sun, 21 Aug 2022 04:14:12 +0000 (14:14 +1000)
./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 <abelur@linuxfoundation.org>
shell/common-variables.sh
shell/docker-build.sh
shell/docker-login.sh
shell/docker-push.sh
shell/gerrit-branch-lock.sh

index 5092a8e..be0a451 100644 (file)
@@ -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
index 0e8b709..c5a1292 100644 (file)
@@ -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"
index d172a3b..97e030b 100644 (file)
@@ -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() {
index 340bc2d..9348e8c 100644 (file)
@@ -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"
index 60f28fe..88f5a22 100644 (file)
@@ -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"
         ;;