From 31567c2d4aa09303827394078ed68fbdfef6f4ae Mon Sep 17 00:00:00 2001 From: YanxuanLiu Date: Wed, 4 Dec 2024 03:24:39 +0800 Subject: [PATCH] split command to avoid masking error Signed-off-by: YanxuanLiu --- .../mvn-verify-check/populate-daily-cache.sh | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/mvn-verify-check/populate-daily-cache.sh b/.github/workflows/mvn-verify-check/populate-daily-cache.sh index 4a6e63407428..d4e9b07d1a71 100755 --- a/.github/workflows/mvn-verify-check/populate-daily-cache.sh +++ b/.github/workflows/mvn-verify-check/populate-daily-cache.sh @@ -14,23 +14,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex +set -e +set -o pipefail -max_retry=3; delay=30; i=1 if [[ $SCALA_VER == '2.12' ]]; then pom='pom.xml' elif [[ $SCALA_VER == '2.13' ]]; then pom='scala2.13/pom.xml' fi + +max_retry=3; delay=30; i=1 while true; do + buildvers=($(python build/get_buildvers.py no_snapshots $pom | tr -d ',')) && { - python build/get_buildvers.py "buildvers.no_snapshots" $pom | tr -d ',' | \ - xargs -n 1 -I {} bash -c \ - "mvn $COMMON_MVN_FLAGS --file $pom -Dbuildver={} de.qaware.maven:go-offline-maven-plugin:resolve-dependencies" - + for buildver in "${buildvers[@]}"; do + mvn $COMMON_MVN_FLAGS --file $pom -Dbuildver=$buildver de.qaware.maven:go-offline-maven-plugin:resolve-dependencies + done + } && { # compile base versions to cache scala compiler and compiler bridge - mvn $COMMON_MVN_FLAGS --file $pom \ - process-test-resources -pl sql-plugin-api -am + mvn $COMMON_MVN_FLAGS --file $pom process-test-resources -pl sql-plugin-api -am } && break || { if [[ $i -le $max_retry ]]; then echo "mvn command failed. Retry $i/$max_retry."; ((i++)); sleep $delay; ((delay=delay*2)) @@ -38,4 +40,4 @@ while true; do echo "mvn command failed. Exit 1"; exit 1 fi } -done \ No newline at end of file +done