From: Anil Belur Date: Tue, 9 Aug 2022 07:22:42 +0000 (+1000) Subject: Chore: Fix bashate warnings X-Git-Tag: v0.79.4~3 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F70467%2F2;p=releng%2Fglobal-jjb.git Chore: Fix bashate warnings ./shell/autotools-sonarqube.sh:59:1: E006 Line too long ./shell/check-info-votes.sh:45:1: E006 Line too long ./shell/check-info-votes.sh:54:1: E006 Line too long ./shell/check-info-votes.sh:56:1: E006 Line too long ./shell/cmake-sonar.sh:25:1: E006 Line too long ./shell/cmake-sonar.sh:31:1: E006 Line too long ./shell/cmake-sonar.sh:49:1: E006 Line too long ./shell/cmake-sonarqube.sh:31:1: E006 Line too long ./shell/cmake-sonarqube.sh:44:1: E006 Line too long ./shell/cmake-stage.sh:42:1: E006 Line too long ./shell/cmake-stage.sh:64:1: E006 Line too long ./shell/cmake-stage.sh:68:1: E006 Line too long Issue-ID: RELENG-4358 Signed-off-by: Anil Belur Change-Id: I5f4a9dab38287901fcac9937fec111a1020de27e --- diff --git a/shell/autotools-sonarqube.sh b/shell/autotools-sonarqube.sh index c52b9bbc..c8e20834 100644 --- a/shell/autotools-sonarqube.sh +++ b/shell/autotools-sonarqube.sh @@ -56,6 +56,7 @@ eval $c --prefix="$INSTALL_PREFIX" $configure_opts # $make_opts may be empty # make needs to wordsplit to pass options # shellcheck disable=SC2086 -eval /opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$build_wrap_dir" make $make_opts +eval /opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir \ + "$build_wrap_dir" make $make_opts echo "---> autotools-sonarqube.sh ends" diff --git a/shell/check-info-votes.sh b/shell/check-info-votes.sh index da6b608e..69d0b484 100644 --- a/shell/check-info-votes.sh +++ b/shell/check-info-votes.sh @@ -42,7 +42,8 @@ $pip install --user lftools[nexus] $pip install --user jsonschema echo "Checking votes:" -lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt +lftools infofile check-votes INFO.yaml "$GERRIT_URL" \ + "$ref" > gerrit_comment.txt exit_status="$?" if [[ "$exit_status" -ne 0 ]]; then @@ -51,7 +52,9 @@ if [[ "$exit_status" -ne 0 ]]; then exit "$exit_status" else echo "Vote completed submitting review" - ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --verified 1 + ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review \ + "$GERRIT_PATCHSET_REVISION" --verified 1 sleep 5 - ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --submit + ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review \ + "$GERRIT_PATCHSET_REVISION" --submit fi diff --git a/shell/cmake-sonar.sh b/shell/cmake-sonar.sh index e64ca69c..0bbf559e 100644 --- a/shell/cmake-sonar.sh +++ b/shell/cmake-sonar.sh @@ -22,13 +22,18 @@ set -ex -o pipefail export SET_JDK_VERSION="${SET_JDK_VERSION:-openjdk11}" echo "$SET_JDK_VERSION" -bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh) +GITHUB_RAW_BASE_URL="https://raw.githubusercontent.com" +GITHUB_FILE="lfit/releng-global-jjb/master/shell/update-java-alternatives.sh" +bash <(curl -s "${GITHUB_RAW_BASE_URL}/${GITHUB_FILE}") # shellcheck disable=SC1091 source /tmp/java.env cd /tmp || exit 1 +SONAR_BASE_URL="https://binaries.sonarsource.com" +SONAR_SCANER_PATH="Distribution/sonar-scanner-cli" +SONAR_SCANER_CLI="sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" wget -q -O /tmp/sonar-scan.zip \ - "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip" + "${SONAR_BASE_URL}/${SONAR_SCANER_PATH}/${SONAR_SCANER_CLI}" unzip -q sonar-scan.zip sudo mv sonar-scanner-* /opt/sonar-scanner @@ -45,8 +50,8 @@ eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts .. # $make_opts may be empty. # shellcheck disable=SC2086 -/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$WORKSPACE/bw-output" \ - make $make_opts +/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir \ + "$WORKSPACE/bw-output" make $make_opts /opt/sonar-scanner/bin/sonar-scanner \ -Dsonar.projectKey="${PROJECT_KEY}" \ diff --git a/shell/cmake-sonarqube.sh b/shell/cmake-sonarqube.sh index f34f7d79..d335419d 100644 --- a/shell/cmake-sonarqube.sh +++ b/shell/cmake-sonarqube.sh @@ -28,7 +28,9 @@ sudo mv build-wrapper-* /opt/build-wrapper export SET_JDK_VERSION="${SET_JDK_VERSION:-openjdk11}" echo "$SET_JDK_VERSION" -bash <(curl -s https://raw.githubusercontent.com/lfit/releng-global-jjb/master/shell/update-java-alternatives.sh) +GITHUB_RAW_BASE_URL="https://raw.githubusercontent.com" +GITHUB_FILE="lfit/releng-global-jjb/master/shell/update-java-alternatives.sh" +bash <(curl -s "${GITHUB_RAW_BASE_URL}/${GITHUB_FILE}") # shellcheck disable=SC1091 source /tmp/java.env @@ -41,6 +43,7 @@ eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts .. # $make_opts may be empty. # shellcheck disable=SC2086 -/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$build_wrap_dir" make $make_opts +/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$build_wrap_dir" \ + make $make_opts echo "---> cmake-sonarqube.sh ends" diff --git a/shell/cmake-stage.sh b/shell/cmake-stage.sh index b91d6e1e..ad3fbee1 100644 --- a/shell/cmake-stage.sh +++ b/shell/cmake-stage.sh @@ -39,7 +39,8 @@ if [ -z "${version}" ]; then fi fi -repo_id=$(lftools deploy nexus-stage-repo-create "$NEXUS_URL" "$staging_profile_id") +repo_id=$(lftools deploy nexus-stage-repo-create "$NEXUS_URL" \ + "$staging_profile_id") mapfile -t artifacts < <(ls "$WORKSPACE"/dist) for artifact in "${artifacts[@]}"; do @@ -61,9 +62,11 @@ for artifact in "${artifacts[@]}"; do src.tar.xz done -lftools deploy nexus-stage-repo-close "$NEXUS_URL" "$staging_profile_id" "$repo_id" +lftools deploy nexus-stage-repo-close "$NEXUS_URL" "$staging_profile_id" \ + "$repo_id" PATCH_DIR="$WORKSPACE/archives/patches" mkdir -p "$PATCH_DIR" -echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log" +echo "$PROJECT" "$(git rev-parse --verify HEAD)" | \ + tee -a "$PATCH_DIR/taglist.log" echo "$repo_id" > "$WORKSPACE/archives/staging-repo.txt"