From 5b00d675aae9287a59b5460196cc497176504984 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 26 Jul 2023 13:48:25 -0700 Subject: [PATCH] Make docker command detection consistently across OSes (#254) Signed-off-by: Peter Zhu --- build.gradle | 2 +- tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt | 4 ++-- vars/runGradleCheck.groovy | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index e08f82525..3a9d1f6dd 100644 --- a/build.gradle +++ b/build.gradle @@ -120,7 +120,7 @@ jacocoTestReport { } } -String version = '5.2.0' +String version = '5.3.0' task updateVersion { doLast { diff --git a/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt b/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt index e20675cdf..e7fcd60de 100644 --- a/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RunGradleCheck_Jenkinsfile.txt @@ -37,11 +37,11 @@ ./gradlew --stop rm -rf ~/.gradle - if ! (uname -s | grep -i NT); then + if command -v docker > /dev/null; then echo "Check existing dockercontainer" docker ps -a docker stop `docker ps -qa` > /dev/null 2>&1 || echo - docker rm `docker ps -qa` > /dev/null 2>&1 || echo + docker rm --force `docker ps -qa` > /dev/null 2>&1 || echo echo "Stop existing dockercontainer" docker ps -a diff --git a/vars/runGradleCheck.groovy b/vars/runGradleCheck.groovy index 533c13ae3..54f7bf136 100644 --- a/vars/runGradleCheck.groovy +++ b/vars/runGradleCheck.groovy @@ -51,11 +51,11 @@ void call(Map args = [:]) { ./gradlew --stop rm -rf ~/.gradle - if ! (uname -s | grep -i NT); then + if command -v docker > /dev/null; then echo "Check existing dockercontainer" docker ps -a docker stop `docker ps -qa` > /dev/null 2>&1 || echo - docker rm `docker ps -qa` > /dev/null 2>&1 || echo + docker rm --force `docker ps -qa` > /dev/null 2>&1 || echo echo "Stop existing dockercontainer" docker ps -a