From 4740edba6441ba894080a2e7253d8ae10e3664ca Mon Sep 17 00:00:00 2001 From: YanxuanLiu Date: Fri, 19 Jul 2024 14:10:36 +0800 Subject: [PATCH] add populate script Signed-off-by: YanxuanLiu --- .../mvn-verify-check.yml | 46 +------------------ .../mvn-verify-check/populate-daily-cache.sh | 38 +++++++++++++++ 2 files changed, 40 insertions(+), 44 deletions(-) rename .github/workflows/{ => mvn-verify-check}/mvn-verify-check.yml (88%) create mode 100755 .github/workflows/mvn-verify-check/populate-daily-cache.sh diff --git a/.github/workflows/mvn-verify-check.yml b/.github/workflows/mvn-verify-check/mvn-verify-check.yml similarity index 88% rename from .github/workflows/mvn-verify-check.yml rename to .github/workflows/mvn-verify-check/mvn-verify-check.yml index c5424143e40..365d8a15fb9 100644 --- a/.github/workflows/mvn-verify-check.yml +++ b/.github/workflows/mvn-verify-check/mvn-verify-check.yml @@ -65,28 +65,7 @@ jobs: - name: populate-daily-cache if: steps.cache.outputs.cache-hit != 'true' run: | - set -x - max_retry=3; delay=30; i=1 - while true; do - for pom in pom.xml - do - mvn ${{ env.COMMON_MVN_FLAGS }} --file $pom help:evaluate -pl dist \ - -Dexpression=included_buildvers \ - -DforceStdout -PnoSnapshots -q | tr -d ',' | \ - xargs -n 1 bash -c \ - 'mvn ${{ env.COMMON_MVN_FLAGS }} --file $1 -Dbuildver=$2 de.qaware.maven:go-offline-maven-plugin:resolve-dependencies' _ $pom - - # compile base versions to cache scala compiler and compiler bridge - mvn ${{ env.COMMON_MVN_FLAGS }} --file $pom \ - process-test-resources -pl sql-plugin-api -am - done && break || { - if [[ $i -le $max_retry ]]; then - echo "mvn command failed. Retry $i/$max_retry."; ((i++)); sleep $delay; ((delay=delay*2)) - else - echo "mvn command failed. Exit 1"; exit 1 - fi - } - done + . .github/workflows/mvn-verify-check/populate-daily-cache.sh - name: all shim versions id: all212ShimVersionsStep run: | @@ -197,28 +176,7 @@ jobs: - name: populate-daily-cache if: steps.cache.outputs.cache-hit != 'true' run: | - set -x - max_retry=3; delay=30; i=1 - while true; do - for pom in pom.xml - do - mvn ${{ env.COMMON_MVN_FLAGS }} --file $pom help:evaluate -pl dist \ - -Dexpression=included_buildvers \ - -DforceStdout -PnoSnapshots -q | tr -d ',' | \ - xargs -n 1 bash -c \ - 'mvn ${{ env.COMMON_MVN_FLAGS }} --file $1 -Dbuildver=$2 de.qaware.maven:go-offline-maven-plugin:resolve-dependencies' _ $pom - - # compile base versions to cache scala compiler and compiler bridge - mvn ${{ env.COMMON_MVN_FLAGS }} --file $pom \ - process-test-resources -pl sql-plugin-api -am - done && break || { - if [[ $i -le $max_retry ]]; then - echo "mvn command failed. Retry $i/$max_retry."; ((i++)); sleep $delay; ((delay=delay*2)) - else - echo "mvn command failed. Exit 1"; exit 1 - fi - } - done + . .github/workflows/mvn-verify-check/populate-daily-cache.sh - name: all 213 shim verions id: all213ShimVersionsStep run: | diff --git a/.github/workflows/mvn-verify-check/populate-daily-cache.sh b/.github/workflows/mvn-verify-check/populate-daily-cache.sh new file mode 100755 index 00000000000..c4bd27479c6 --- /dev/null +++ b/.github/workflows/mvn-verify-check/populate-daily-cache.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (c) 2024, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +max_retry=3; delay=30; i=1 +while true; do +for pom in pom.xml +do + mvn $COMMON_MVN_FLAGS --file $pom help:evaluate -pl dist \ + -Dexpression=included_buildvers \ + -DforceStdout -PnoSnapshots -q | tr -d ',' | \ + xargs -n 1 bash -c \ + "mvn $COMMON_MVN_FLAGS --file $1 -Dbuildver=$2 de.qaware.maven:go-offline-maven-plugin:resolve-dependencies" _ $pom + + # compile base versions to cache scala compiler and compiler bridge + mvn $COMMON_MVN_FLAGS --file $pom \ + process-test-resources -pl sql-plugin-api -am +done && break || { +if [[ $i -le $max_retry ]]; then + echo "mvn command failed. Retry $i/$max_retry."; ((i++)); sleep $delay; ((delay=delay*2)) +else + echo "mvn command failed. Exit 1"; exit 1 +fi +} +done \ No newline at end of file