Skip to content

Commit

Permalink
[Backport 7.x] Use HOME var instead of tilde to be more comparible wi…
Browse files Browse the repository at this point in the history
…th Windows (#543)

Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4056ccb commit 79384d9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jacocoTestReport {
}
}

String version = '7.2.0'
String version = '7.2.1'

task updateVersion {
doLast {
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestRetrievePreviousBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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/')))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion tests/jenkins/jobs/RetrievePreviousBuild_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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({[email protected], retriever=null})
Expand Down
2 changes: 1 addition & 1 deletion vars/retrievePreviousBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
}

}

0 comments on commit 79384d9

Please sign in to comment.