From 44c1aa60ae4ad258d19b7d1e3dfa7121e6e27d2c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 18 Jul 2024 21:20:56 -0400 Subject: [PATCH] Bump publish min artifacts to use 6.6.1 libs (#4866) Signed-off-by: Peter Zhu --- .../publish-min-snapshots.jenkinsfile | 2 +- tests/jenkins/TestPublishMinSnapshots.groovy | 3 +- .../publish-min-snapshots.jenkinsfile.txt | 38 ++++++++++++++----- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/jenkins/opensearch/publish-min-snapshots.jenkinsfile b/jenkins/opensearch/publish-min-snapshots.jenkinsfile index 2b42477cb7..8b6d96568c 100644 --- a/jenkins/opensearch/publish-min-snapshots.jenkinsfile +++ b/jenkins/opensearch/publish-min-snapshots.jenkinsfile @@ -7,7 +7,7 @@ * compatible open source license. */ -lib = library(identifier: 'jenkins@5.12.0', retriever: modernSCM([ +lib = library(identifier: 'jenkins@6.6.1', retriever: modernSCM([ $class: 'GitSCMSource', remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git', ])) diff --git a/tests/jenkins/TestPublishMinSnapshots.groovy b/tests/jenkins/TestPublishMinSnapshots.groovy index cd5dad3e01..c3095a9581 100644 --- a/tests/jenkins/TestPublishMinSnapshots.groovy +++ b/tests/jenkins/TestPublishMinSnapshots.groovy @@ -25,7 +25,7 @@ class TestPublishMinSnapshots extends BuildPipelineTest { helper.registerSharedLibrary( library().name('jenkins') - .defaultVersion('5.12.0') + .defaultVersion('6.6.1') .allowOverride(true) .implicit(true) .targetPath('vars') @@ -46,6 +46,7 @@ class TestPublishMinSnapshots extends BuildPipelineTest { binding.setVariable('ARTIFACT_PRODUCTION_BUCKET_NAME', 'production-s3-bucket-name') binding.setVariable('ARTIFACT_PROMOTION_ROLE_NAME', 'production-role-name') binding.setVariable('AWS_ACCOUNT_ARTIFACT', 'aws-account-artifact') + binding.setVariable('JOB_NAME', 'distribution-build-opensearch') binding.setVariable('dockerAgent', [image:'opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v3', args:'-e JAVA_HOME=/opt/java/openjdk-20']) helper.registerAllowedMethod('withCredentials', [Map, Closure], { args, closure -> closure.delegate = delegate diff --git a/tests/jenkins/jenkinsjob-regression-files/opensearch/publish-min-snapshots.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/opensearch/publish-min-snapshots.jenkinsfile.txt index fdae3061a3..6c6e2a6ccd 100644 --- a/tests/jenkins/jenkinsjob-regression-files/opensearch/publish-min-snapshots.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/opensearch/publish-min-snapshots.jenkinsfile.txt @@ -1,6 +1,6 @@ publish-min-snapshots.run() publish-min-snapshots.modernSCM({$class=GitSCMSource, remote=https://github.com/opensearch-project/opensearch-build-libraries.git}) - publish-min-snapshots.library({identifier=jenkins@5.12.0, retriever=null}) + publish-min-snapshots.library({identifier=jenkins@6.6.1, retriever=null}) publish-min-snapshots.pipeline(groovy.lang.Closure) publish-min-snapshots.timeout({time=1, unit=HOURS}) publish-min-snapshots.echo(Executing on agent [label:none]) @@ -9,7 +9,7 @@ publish-min-snapshots.script(groovy.lang.Closure) publish-min-snapshots.detectDockerAgent() detectDockerAgent.legacySCM(groovy.lang.Closure) - detectDockerAgent.library({identifier=jenkins@5.12.0, retriever=null}) + detectDockerAgent.library({identifier=jenkins@6.6.1, retriever=null}) detectDockerAgent.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() detectDockerAgent.echo(Using Docker image opensearchstaging/ci-runner:ci-runner-centos7-v1 (null)) @@ -18,12 +18,16 @@ publish-min-snapshots.echo(Executing on agent [docker:[alwaysPull:true, args:-e JAVA_HOME=/opt/java/openjdk-20, containerPerStageRoot:false, label:Jenkins-Agent-AL2023-X64-C54xlarge-Docker-Host, image:opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v3, reuseNode:false, registryUrl:https://public.ecr.aws/, stages:[:]]]) publish-min-snapshots.script(groovy.lang.Closure) publish-min-snapshots.buildManifest({componentName=OpenSearch, inputManifest=manifests/3.0.0/opensearch-3.0.0.yml, platform=linux, architecture=x64, distribution=tar, snapshot=true}) + buildManifest.legacySCM(groovy.lang.Closure) + buildManifest.library({identifier=jenkins@6.6.1, retriever=null}) + buildManifest.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) + InputManifest.asBoolean() buildManifest.sh(./build.sh manifests/3.0.0/opensearch-3.0.0.yml -d tar --component OpenSearch -p linux -a x64 --snapshot) publish-min-snapshots.echo(Uploading linux x64 tar min snapshots to S3) publish-min-snapshots.createSha512Checksums() publish-min-snapshots.uploadMinSnapshotsToS3({fileActions=[groovy.lang.Closure], distribution=tar}) uploadMinSnapshotsToS3.legacySCM(groovy.lang.Closure) - uploadMinSnapshotsToS3.library({identifier=jenkins@5.12.0, retriever=null}) + uploadMinSnapshotsToS3.library({identifier=jenkins@6.6.1, retriever=null}) uploadMinSnapshotsToS3.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() uploadMinSnapshotsToS3.echo(Retreving build manifest from: /tmp/workspace/tar/builds/opensearch/manifest.yml) @@ -54,12 +58,16 @@ publish-min-snapshots.echo(Executing on agent [docker:[alwaysPull:true, args:-e JAVA_HOME=/opt/java/openjdk-20, containerPerStageRoot:false, label:Jenkins-Agent-AL2023-Arm64-C6g4xlarge-Docker-Host, image:opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v3, reuseNode:false, registryUrl:https://public.ecr.aws/, stages:[:]]]) publish-min-snapshots.script(groovy.lang.Closure) publish-min-snapshots.buildManifest({componentName=OpenSearch, inputManifest=manifests/3.0.0/opensearch-3.0.0.yml, platform=linux, architecture=arm64, distribution=tar, snapshot=true}) + buildManifest.legacySCM(groovy.lang.Closure) + buildManifest.library({identifier=jenkins@6.6.1, retriever=null}) + buildManifest.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) + InputManifest.asBoolean() buildManifest.sh(./build.sh manifests/3.0.0/opensearch-3.0.0.yml -d tar --component OpenSearch -p linux -a arm64 --snapshot) publish-min-snapshots.echo(Uploading linux arm64 tar min snapshots to S3) publish-min-snapshots.createSha512Checksums() publish-min-snapshots.uploadMinSnapshotsToS3({fileActions=[groovy.lang.Closure], distribution=tar}) uploadMinSnapshotsToS3.legacySCM(groovy.lang.Closure) - uploadMinSnapshotsToS3.library({identifier=jenkins@5.12.0, retriever=null}) + uploadMinSnapshotsToS3.library({identifier=jenkins@6.6.1, retriever=null}) uploadMinSnapshotsToS3.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() uploadMinSnapshotsToS3.echo(Retreving build manifest from: /tmp/workspace/tar/builds/opensearch/manifest.yml) @@ -93,12 +101,16 @@ publish-min-snapshots.sh(/usr/local/bin/update-alternatives --set java `/usr/local/bin/update-alternatives --list java | grep openjdk-17`) publish-min-snapshots.sh(java -version) publish-min-snapshots.buildManifest({componentName=OpenSearch, inputManifest=manifests/3.0.0/opensearch-3.0.0.yml, platform=darwin, architecture=x64, distribution=tar, snapshot=true}) + buildManifest.legacySCM(groovy.lang.Closure) + buildManifest.library({identifier=jenkins@6.6.1, retriever=null}) + buildManifest.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) + InputManifest.asBoolean() buildManifest.sh(./build.sh manifests/3.0.0/opensearch-3.0.0.yml -d tar --component OpenSearch -p darwin -a x64 --snapshot) publish-min-snapshots.echo(Uploading darwin x64 tar min snapshots to S3) publish-min-snapshots.createSha512Checksums() publish-min-snapshots.uploadMinSnapshotsToS3({fileActions=[groovy.lang.Closure], distribution=tar}) uploadMinSnapshotsToS3.legacySCM(groovy.lang.Closure) - uploadMinSnapshotsToS3.library({identifier=jenkins@5.12.0, retriever=null}) + uploadMinSnapshotsToS3.library({identifier=jenkins@6.6.1, retriever=null}) uploadMinSnapshotsToS3.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() uploadMinSnapshotsToS3.echo(Retreving build manifest from: /tmp/workspace/tar/builds/opensearch/manifest.yml) @@ -113,7 +125,7 @@ cp -v /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64.tar.gz /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64-latest.tar.gz cp -v /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64.tar.gz.sha512 /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64-latest.tar.gz.sha512 cp -v /tmp/workspace/tar/builds/opensearch/dist/../manifest.yml /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64-latest.tar.gz.build-manifest.yml - sed -i "s/.tar.gz/-latest.tar.gz/g" /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64-latest.tar.gz.sha512 + gsed -i "s/.tar.gz/-latest.tar.gz/g" /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-x64-latest.tar.gz.sha512 ) uploadMinSnapshotsToS3.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) uploadMinSnapshotsToS3.string({credentialsId=jenkins-aws-production-account, variable=AWS_ACCOUNT_ARTIFACT}) @@ -132,12 +144,16 @@ publish-min-snapshots.sh(/opt/homebrew/bin/update-alternatives --set java `/opt/homebrew/bin/update-alternatives --list java | grep openjdk-17`) publish-min-snapshots.sh(java -version) publish-min-snapshots.buildManifest({componentName=OpenSearch, inputManifest=manifests/3.0.0/opensearch-3.0.0.yml, platform=darwin, architecture=arm64, distribution=tar, snapshot=true}) + buildManifest.legacySCM(groovy.lang.Closure) + buildManifest.library({identifier=jenkins@6.6.1, retriever=null}) + buildManifest.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) + InputManifest.asBoolean() buildManifest.sh(./build.sh manifests/3.0.0/opensearch-3.0.0.yml -d tar --component OpenSearch -p darwin -a arm64 --snapshot) publish-min-snapshots.echo(Uploading darwin arm64 tar min snapshots to S3) publish-min-snapshots.createSha512Checksums() publish-min-snapshots.uploadMinSnapshotsToS3({fileActions=[groovy.lang.Closure], distribution=tar}) uploadMinSnapshotsToS3.legacySCM(groovy.lang.Closure) - uploadMinSnapshotsToS3.library({identifier=jenkins@5.12.0, retriever=null}) + uploadMinSnapshotsToS3.library({identifier=jenkins@6.6.1, retriever=null}) uploadMinSnapshotsToS3.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() uploadMinSnapshotsToS3.echo(Retreving build manifest from: /tmp/workspace/tar/builds/opensearch/manifest.yml) @@ -152,7 +168,7 @@ cp -v /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64.tar.gz /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz cp -v /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64.tar.gz.sha512 /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz.sha512 cp -v /tmp/workspace/tar/builds/opensearch/dist/../manifest.yml /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz.build-manifest.yml - sed -i "s/.tar.gz/-latest.tar.gz/g" /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz.sha512 + gsed -i "s/.tar.gz/-latest.tar.gz/g" /tmp/workspace/tar/builds/opensearch/dist/opensearch-min-3.0.0-SNAPSHOT-darwin-arm64-latest.tar.gz.sha512 ) uploadMinSnapshotsToS3.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) uploadMinSnapshotsToS3.string({credentialsId=jenkins-aws-production-account, variable=AWS_ACCOUNT_ARTIFACT}) @@ -170,12 +186,16 @@ publish-min-snapshots.echo(Switching to Java 17 on Windows Docker Container) publish-min-snapshots.sh(scoop reset `scoop list jdk | cut -d ' ' -f1 | grep 17 | head -1`) publish-min-snapshots.buildManifest({componentName=OpenSearch, inputManifest=manifests/3.0.0/opensearch-3.0.0.yml, platform=windows, architecture=x64, distribution=zip, snapshot=true}) + buildManifest.legacySCM(groovy.lang.Closure) + buildManifest.library({identifier=jenkins@6.6.1, retriever=null}) + buildManifest.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) + InputManifest.asBoolean() buildManifest.sh(./build.sh manifests/3.0.0/opensearch-3.0.0.yml -d zip --component OpenSearch -p windows -a x64 --snapshot) publish-min-snapshots.echo(Uploading windows x64 zip min snapshots to S3) publish-min-snapshots.createSha512Checksums() publish-min-snapshots.uploadMinSnapshotsToS3({fileActions=[groovy.lang.Closure], distribution=zip}) uploadMinSnapshotsToS3.legacySCM(groovy.lang.Closure) - uploadMinSnapshotsToS3.library({identifier=jenkins@5.12.0, retriever=null}) + uploadMinSnapshotsToS3.library({identifier=jenkins@6.6.1, retriever=null}) uploadMinSnapshotsToS3.readYaml({file=manifests/3.0.0/opensearch-3.0.0.yml}) InputManifest.asBoolean() uploadMinSnapshotsToS3.echo(Retreving build manifest from: /tmp/workspace/zip/builds/opensearch/manifest.yml)