From ad33c8a654dec507dfa8846450628ce7472427c2 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 29 Jun 2022 22:50:30 +0000 Subject: [PATCH] Add gradle cleanup before the checks Signed-off-by: Peter Zhu --- tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt | 6 +++--- vars/runGradleCheck.groovy | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt b/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt index a84cf40b88..47ab1dc84b 100644 --- a/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt @@ -37,9 +37,9 @@ env | grep JAVA | grep HOME - echo "Stop existing gradledaemon" + echo "Gradle clean cache and stop existing gradledaemon" ./gradlew --stop - find ~/.gradle -type f -name "*.lock" -delete + rm -rf ~/.gradle echo "Check existing dockercontainer" docker ps -a @@ -59,7 +59,7 @@ echo "Start gradlecheck" GRADLE_CHECK_STATUS=0 - ./gradlew check -Dtests.coverage=true --no-daemon --no-scan || GRADLE_CHECK_STATUS=1 + ./gradlew clean && ./gradlew check -Dtests.coverage=true --no-daemon --no-scan || GRADLE_CHECK_STATUS=1 if [ "$GRADLE_CHECK_STATUS" != 0 ]; then echo Gradle Check Failed! diff --git a/vars/runGradleCheck.groovy b/vars/runGradleCheck.groovy index bc727def2c..3705fbebd7 100644 --- a/vars/runGradleCheck.groovy +++ b/vars/runGradleCheck.groovy @@ -43,9 +43,9 @@ void call(Map args = [:]) { env | grep JAVA | grep HOME - echo "Stop existing gradledaemon" + echo "Gradle clean cache and stop existing gradledaemon" ./gradlew --stop - find ~/.gradle -type f -name "*.lock" -delete + rm -rf ~/.gradle echo "Check existing dockercontainer" docker ps -a @@ -65,7 +65,7 @@ void call(Map args = [:]) { echo "Start gradlecheck" GRADLE_CHECK_STATUS=0 - ./gradlew check -Dtests.coverage=true --no-daemon --no-scan || GRADLE_CHECK_STATUS=1 + ./gradlew clean && ./gradlew check -Dtests.coverage=true --no-daemon --no-scan || GRADLE_CHECK_STATUS=1 if [ "\$GRADLE_CHECK_STATUS" != 0 ]; then echo Gradle Check Failed!