diff --git a/tests/jenkins/jobs/uploadMinSnapshotsToS3_Jenkinsfile.txt b/tests/jenkins/jobs/uploadMinSnapshotsToS3_Jenkinsfile.txt index 1b9e80bf2..f99042409 100644 --- a/tests/jenkins/jobs/uploadMinSnapshotsToS3_Jenkinsfile.txt +++ b/tests/jenkins/jobs/uploadMinSnapshotsToS3_Jenkinsfile.txt @@ -28,9 +28,10 @@ ccc bbb ccc }) + uploadMinSnapshotsToS3.echo(Start copying files) uploadMinSnapshotsToS3.sh( - cp tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64.tar.gz tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64-latest.tar.gz - cp tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64.tar.gz.sha512 tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64-latest.tar.gz.sha512 + cp -v tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64.tar.gz tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64-latest.tar.gz + cp -v tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64.tar.gz.sha512 tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64-latest.tar.gz.sha512 sed -i "s/.tar.gz/-latest.tar.gz/g" tests/data/tar/builds/opensearch/dist/opensearch-min-1.2.2-SNAPSHOT-linux-x64-latest.tar.gz.sha512 ) uploadMinSnapshotsToS3.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) diff --git a/vars/createSha512Checksums.groovy b/vars/createSha512Checksums.groovy index 5e983088e..2370e715c 100644 --- a/vars/createSha512Checksums.groovy +++ b/vars/createSha512Checksums.groovy @@ -11,7 +11,7 @@ Closure call() { return { argsMap -> body: { - final foundFiles = sh(script: "find $argsMap.artifactPath -type f", returnStdout: true).split() + final foundFiles = sh(script: "find ${argsMap.artifactPath} -type f", returnStdout: true).split() for (file in foundFiles) { acceptTypeFound = false diff --git a/vars/uploadMinSnapshotsToS3.groovy b/vars/uploadMinSnapshotsToS3.groovy index a0b58af2e..53d83d2ef 100644 --- a/vars/uploadMinSnapshotsToS3.groovy +++ b/vars/uploadMinSnapshotsToS3.groovy @@ -23,9 +23,12 @@ void call(Map args = [:]) { extension = buildManifest.build.getExtension() // Setup src & dst variables for artifacts - srcDir = "${WORKSPACE}/${args.distribution}/builds/${productName}/dist" - dstDir = "snapshots/core/${productName}/${version}" - baseName = "${productName}-min-${version}-${platform}-${architecture}" + // Replace backslash with forward slash ('\' to '/') in path + // Compatible with both Windows as well as any nix* env + // Else the map in groovy will treat '\' as escape char on Windows + String srcDir = "${WORKSPACE}/${args.distribution}/builds/${productName}/dist".replace("\\", "/") + String dstDir = "snapshots/core/${productName}/${version}" + String baseName = "${productName}-min-${version}-${platform}-${architecture}" // Create checksums echo('Create .sha512 for Min Snapshots Artifacts') @@ -35,9 +38,11 @@ void call(Map args = [:]) { action(argsMap) } + echo('Start copying files') + sh """ - cp ${srcDir}/${baseName}.${extension} ${srcDir}/${baseName}-latest.${extension} - cp ${srcDir}/${baseName}.${extension}.sha512 ${srcDir}/${baseName}-latest.${extension}.sha512 + cp -v ${srcDir}/${baseName}.${extension} ${srcDir}/${baseName}-latest.${extension} + cp -v ${srcDir}/${baseName}.${extension}.sha512 ${srcDir}/${baseName}-latest.${extension}.sha512 sed -i "s/.${extension}/-latest.${extension}/g" ${srcDir}/${baseName}-latest.${extension}.sha512 """ withCredentials([