From 8b2c0b3f3213e00c1794e0a6bd1923dafd803d04 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Oct 2024 23:59:38 +0000 Subject: [PATCH] Use HOME var instead of tilde to be more comparible with Windows (#542) Signed-off-by: Peter Zhu (cherry picked from commit b7e7b620ce96ee0a293721e244adb48cdf9c2fff) Signed-off-by: github-actions[bot] --- build.gradle | 2 +- tests/jenkins/TestRetrievePreviousBuild.groovy | 2 +- tests/jenkins/jobs/BuildShManifestIncremental_Jenkinsfile.txt | 2 +- tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt | 2 +- vars/retrievePreviousBuild.groovy | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index de4be937f..1b23eb01e 100644 --- a/build.gradle +++ b/build.gradle @@ -128,7 +128,7 @@ jacocoTestReport { } } -String version = '7.2.0' +String version = '7.2.1' task updateVersion { doLast { diff --git a/tests/jenkins/TestRetrievePreviousBuild.groovy b/tests/jenkins/TestRetrievePreviousBuild.groovy index 11d001aa5..a903f3edf 100644 --- a/tests/jenkins/TestRetrievePreviousBuild.groovy +++ b/tests/jenkins/TestRetrievePreviousBuild.groovy @@ -34,7 +34,7 @@ class TestRetrievePreviousBuild extends BuildPipelineTest { super.testPipeline('tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile') def shCommands = getCommands('sh', 'mkdir') assertThat(shCommands, hasItems('rm -rf tar && mkdir -p tar && mv -v /tmp/workspace/download/dummy_job/2.12.0/123/linux/x64/tar/* /tmp/workspace/tar')) - assertThat(shCommands, hasItems('mkdir -p ~/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ ~/.m2/repository/org/')) + assertThat(shCommands, hasItems('mkdir -p $HOME/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ $HOME/.m2/repository/org/')) assertThat(shCommands, hasItems('rm -rf zip && mkdir -p zip && mv -v /tmp/workspace/download/dummy_job/2.12.0/1234/windows/x64/zip/* /tmp/workspace/zip')) assertThat(shCommands, not(hasItems('mkdir -p ~/.m2/repository/org/ && cp -r zip/builds/opensearch/maven/org/opensearch/ ~/.m2/repository/org/'))) diff --git a/tests/jenkins/jobs/BuildShManifestIncremental_Jenkinsfile.txt b/tests/jenkins/jobs/BuildShManifestIncremental_Jenkinsfile.txt index 4cd2b3f0d..b976b2944 100644 --- a/tests/jenkins/jobs/BuildShManifestIncremental_Jenkinsfile.txt +++ b/tests/jenkins/jobs/BuildShManifestIncremental_Jenkinsfile.txt @@ -31,5 +31,5 @@ ccc/linux/x64/tar/, force=true}) retrievePreviousBuild.sh(rm -rf tar && mkdir -p tar && mv -v /tmp/workspace/download/dummy-build-job/2.12.0/bbb ccc/linux/x64/tar/* /tmp/workspace/tar) retrievePreviousBuild.echo(Setting up Maven Local for OpenSearch build.) - retrievePreviousBuild.sh(mkdir -p ~/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ ~/.m2/repository/org/) + retrievePreviousBuild.sh(mkdir -p $HOME/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ $HOME/.m2/repository/org/) buildManifest.sh(./build.sh tests/data/opensearch-input-2.12.0.yml -d tar -p linux -a x64 --incremental) diff --git a/tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt b/tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt index 41120a479..e1e93b45c 100644 --- a/tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt @@ -17,7 +17,7 @@ downloadFromS3.s3Download({file=/tmp/workspace/download, bucket=ARTIFACT_BUCKET_NAME, path=dummy_job/2.12.0/123/linux/x64/tar/, force=true}) retrievePreviousBuild.sh(rm -rf tar && mkdir -p tar && mv -v /tmp/workspace/download/dummy_job/2.12.0/123/linux/x64/tar/* /tmp/workspace/tar) retrievePreviousBuild.echo(Setting up Maven Local for OpenSearch build.) - retrievePreviousBuild.sh(mkdir -p ~/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ ~/.m2/repository/org/) + retrievePreviousBuild.sh(mkdir -p $HOME/.m2/repository/org/ && cp -r tar/builds/opensearch/maven/org/opensearch/ $HOME/.m2/repository/org/) RetrievePreviousBuild_Jenkinsfile.retrievePreviousBuild({inputManifest=tests/data/opensearch-dashboards-input-2.12.0.yml, distribution=zip, architecture=x64, platform=windows, distributionBuildNumber=1234}) retrievePreviousBuild.legacySCM(groovy.lang.Closure) retrievePreviousBuild.library({identifier=jenkins@7.2.0, retriever=null}) diff --git a/vars/retrievePreviousBuild.groovy b/vars/retrievePreviousBuild.groovy index 90a50961b..cf92d2a69 100644 --- a/vars/retrievePreviousBuild.groovy +++ b/vars/retrievePreviousBuild.groovy @@ -43,7 +43,7 @@ void call(Map args = [:]) { sh("rm -rf ${distribution} && mkdir -p ${distribution} && mv -v ${prefixPath}/${artifactPath}/* ${WORKSPACE}/${distribution}") if (inputManifestObj.build.getFilename().equals("opensearch")) { echo("Setting up Maven Local for OpenSearch build.") - sh("mkdir -p ~/.m2/repository/org/ && cp -r ${distribution}/builds/opensearch/maven/org/opensearch/ ~/.m2/repository/org/") + sh("mkdir -p \$HOME/.m2/repository/org/ && cp -r ${distribution}/builds/opensearch/maven/org/opensearch/ \$HOME/.m2/repository/org/") } }