From 7a1d832b354493d9c3bf0abc34dec278dab90978 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Tue, 19 Jul 2022 17:24:08 -0700 Subject: [PATCH] Add missing variable Signed-off-by: Sayali Gaikawad --- tests/jenkins/jobs/ArchiveAssembleUpload_Jenkinsfile.txt | 5 +++-- tests/jenkins/jobs/AssembleUpload_Jenkinsfile.txt | 5 +++-- tests/jenkins/jobs/BuildAssembleUpload_Jenkinsfile.txt | 3 ++- vars/uploadArtifacts.groovy | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/jenkins/jobs/ArchiveAssembleUpload_Jenkinsfile.txt b/tests/jenkins/jobs/ArchiveAssembleUpload_Jenkinsfile.txt index dab364ab42..6909c43d72 100644 --- a/tests/jenkins/jobs/ArchiveAssembleUpload_Jenkinsfile.txt +++ b/tests/jenkins/jobs/ArchiveAssembleUpload_Jenkinsfile.txt @@ -33,7 +33,8 @@ uploadArtifacts.string({credentialsId=jenkins-artifact-bucket-name, variable=ARTIFACT_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-artifact-production-bucket-name, variable=ARTIFACT_PRODUCTION_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-aws-production-account, variable=AWS_ACCOUNT_ARTIFACT}) - uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT], groovy.lang.Closure) + uploadArtifacts.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) + uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT, ARTIFACT_PROMOTION_ROLE_NAME], groovy.lang.Closure) uploadArtifacts.echo(Uploading to s3://ARTIFACT_BUCKET_NAME/vars-build/1.3.0/33/linux/x64/tar) uploadArtifacts.uploadToS3({sourcePath=tar/builds, bucket=ARTIFACT_BUCKET_NAME, path=vars-build/1.3.0/33/linux/x64/tar/builds}) uploadToS3.string({credentialsId=jenkins-aws-account-public, variable=AWS_ACCOUNT_PUBLIC}) @@ -46,7 +47,7 @@ uploadToS3.withAWS({role=opensearch-bundle, roleAccount=AWS_ACCOUNT_PUBLIC, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) uploadToS3.s3Upload({file=tar/dist, bucket=ARTIFACT_BUCKET_NAME, path=vars-build/1.3.0/33/linux/x64/tar/dist}) uploadArtifacts.echo(Uploading to s3://ARTIFACT_PRODUCTION_BUCKET_NAME/vars-build/1.3.0/33/linux/x64/tar) - uploadArtifacts.withAWS({role=role, roleAccount=AWS_ACCOUNT_ARTIFACT, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) + uploadArtifacts.withAWS({role=ARTIFACT_PROMOTION_ROLE_NAME, roleAccount=AWS_ACCOUNT_ARTIFACT, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) uploadArtifacts.s3Upload({file=tar/builds/opensearch/dist/opensearch-min-1.3.0-linux-x64.tar.gz, bucket=ARTIFACT_PRODUCTION_BUCKET_NAME, path=release-candidates/core/opensearch/1.3.0/}) uploadArtifacts.s3Upload({file=tar/dist/opensearch/opensearch-1.3.0-linux-x64.tar.gz, bucket=ARTIFACT_PRODUCTION_BUCKET_NAME, path=release-candidates/bundle/opensearch/1.3.0/}) BuildManifest.getArtifactRootUrl(https://ci.opensearch.org/dbc, vars-build, 33) diff --git a/tests/jenkins/jobs/AssembleUpload_Jenkinsfile.txt b/tests/jenkins/jobs/AssembleUpload_Jenkinsfile.txt index 5a396f87ca..0870027038 100644 --- a/tests/jenkins/jobs/AssembleUpload_Jenkinsfile.txt +++ b/tests/jenkins/jobs/AssembleUpload_Jenkinsfile.txt @@ -23,7 +23,8 @@ uploadArtifacts.string({credentialsId=jenkins-artifact-bucket-name, variable=ARTIFACT_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-artifact-production-bucket-name, variable=ARTIFACT_PRODUCTION_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-aws-production-account, variable=AWS_ACCOUNT_ARTIFACT}) - uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT], groovy.lang.Closure) + uploadArtifacts.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) + uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT, ARTIFACT_PROMOTION_ROLE_NAME], groovy.lang.Closure) uploadArtifacts.echo(Uploading to s3://ARTIFACT_BUCKET_NAME/vars-build/1.1.0/33/linux/x64/tar) uploadArtifacts.uploadToS3({sourcePath=tar/builds, bucket=ARTIFACT_BUCKET_NAME, path=vars-build/1.1.0/33/linux/x64/tar/builds}) uploadToS3.string({credentialsId=jenkins-aws-account-public, variable=AWS_ACCOUNT_PUBLIC}) @@ -36,7 +37,7 @@ uploadToS3.withAWS({role=opensearch-bundle, roleAccount=AWS_ACCOUNT_PUBLIC, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) uploadToS3.s3Upload({file=tar/dist, bucket=ARTIFACT_BUCKET_NAME, path=vars-build/1.1.0/33/linux/x64/tar/dist}) uploadArtifacts.echo(Uploading to s3://ARTIFACT_PRODUCTION_BUCKET_NAME/vars-build/1.1.0/33/linux/x64/tar) - uploadArtifacts.withAWS({role=role, roleAccount=AWS_ACCOUNT_ARTIFACT, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) + uploadArtifacts.withAWS({role=ARTIFACT_PROMOTION_ROLE_NAME, roleAccount=AWS_ACCOUNT_ARTIFACT, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) uploadArtifacts.s3Upload({file=tar/builds/opensearch/dist/opensearch-min-1.1.0-linux-x64.tar.gz, bucket=ARTIFACT_PRODUCTION_BUCKET_NAME, path=release-candidates/core/opensearch/1.1.0/}) uploadArtifacts.s3Upload({file=tar/dist/opensearch/opensearch-1.1.0-linux-x64.tar.gz, bucket=ARTIFACT_PRODUCTION_BUCKET_NAME, path=release-candidates/bundle/opensearch/1.1.0/}) BuildManifest.getArtifactRootUrl(https://ci.opensearch.org/dbc, vars-build, 33) diff --git a/tests/jenkins/jobs/BuildAssembleUpload_Jenkinsfile.txt b/tests/jenkins/jobs/BuildAssembleUpload_Jenkinsfile.txt index 72dbc4aa22..f00e051369 100644 --- a/tests/jenkins/jobs/BuildAssembleUpload_Jenkinsfile.txt +++ b/tests/jenkins/jobs/BuildAssembleUpload_Jenkinsfile.txt @@ -32,7 +32,8 @@ uploadArtifacts.string({credentialsId=jenkins-artifact-bucket-name, variable=ARTIFACT_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-artifact-production-bucket-name, variable=ARTIFACT_PRODUCTION_BUCKET_NAME}) uploadArtifacts.string({credentialsId=jenkins-aws-production-account, variable=AWS_ACCOUNT_ARTIFACT}) - uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT], groovy.lang.Closure) + uploadArtifacts.string({credentialsId=jenkins-artifact-promotion-role, variable=ARTIFACT_PROMOTION_ROLE_NAME}) + uploadArtifacts.withCredentials([ARTIFACT_BUCKET_NAME, ARTIFACT_PRODUCTION_BUCKET_NAME, AWS_ACCOUNT_ARTIFACT, ARTIFACT_PROMOTION_ROLE_NAME], groovy.lang.Closure) uploadArtifacts.echo(Uploading to s3://artifact-bucket/vars-build/1.3.0/33/linux/x64/tar) uploadArtifacts.uploadToS3({sourcePath=tar/builds, bucket=artifact-bucket, path=vars-build/1.3.0/33/linux/x64/tar/builds}) uploadToS3.string({credentialsId=jenkins-aws-account-public, variable=AWS_ACCOUNT_PUBLIC}) diff --git a/vars/uploadArtifacts.groovy b/vars/uploadArtifacts.groovy index f573b7a150..74ef0981cf 100644 --- a/vars/uploadArtifacts.groovy +++ b/vars/uploadArtifacts.groovy @@ -12,7 +12,8 @@ void call(Map args = [:]) { withCredentials([ string(credentialsId: 'jenkins-artifact-bucket-name', variable: 'ARTIFACT_BUCKET_NAME'), string(credentialsId: 'jenkins-artifact-production-bucket-name', variable: 'ARTIFACT_PRODUCTION_BUCKET_NAME'), - string(credentialsId: 'jenkins-aws-production-account', variable: 'AWS_ACCOUNT_ARTIFACT'),]) { + string(credentialsId: 'jenkins-aws-production-account', variable: 'AWS_ACCOUNT_ARTIFACT'), + string(credentialsId: 'jenkins-artifact-promotion-role', variable: 'ARTIFACT_PROMOTION_ROLE_NAME')]) { echo "Uploading to s3://${ARTIFACT_BUCKET_NAME}/${artifactPath}" uploadToS3(