Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore changes from build repo 2550 #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/jenkins/jobs/uploadMinSnapshotsToS3_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion vars/createSha512Checksums.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions vars/uploadMinSnapshotsToS3.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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([
Expand Down