Skip to content

Commit

Permalink
Update buildUploadManifestSHA lib env vars with credentials
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya committed Jun 28, 2022
1 parent aa6ca6e commit 6bb69c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions tests/jenkins/jobs/BuildUploadManifestSHA_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
getManifestSHA.withAWS({role=opensearch-bundle, roleAccount=account, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure)
getManifestSHA.s3DoesObjectExist({bucket=artifact-bucket, path=get-manifest-sha-build/1.3.0/shas/sha1.yml})
getManifestSHA.echo(Manifest SHA exists: false)
buildUploadManifestSHA.withAWS({role=opensearch-bundle, roleAccount=account, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure)
buildUploadManifestSHA.s3Upload({bucket=artifact-bucket, file=tests/jenkins/data/opensearch-1.3.0.yml.lock, path=get-manifest-sha-build/1.3.0/shas/sha1.yml})
buildUploadManifestSHA.string({credentialsId=jenkins-artifact-bucket-name, variable=ARTIFACT_BUCKET_NAME})
buildUploadManifestSHA.string({credentialsId=jenkins-aws-account-public, variable=AWS_ACCOUNT_PUBLIC})
buildUploadManifestSHA.withCredentials([ARTIFACT_BUCKET_NAME, AWS_ACCOUNT_PUBLIC], groovy.lang.Closure)
buildUploadManifestSHA.withAWS({role=opensearch-bundle, roleAccount=AWS_ACCOUNT_PUBLIC, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure)
buildUploadManifestSHA.s3Upload({bucket=ARTIFACT_BUCKET_NAME, file=tests/jenkins/data/opensearch-1.3.0.yml.lock, path=get-manifest-sha-build/1.3.0/shas/sha1.yml})
13 changes: 9 additions & 4 deletions vars/buildUploadManifestSHA.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ void call(Map args = [:]) {

def sha = getManifestSHA(args)

withAWS(role: 'opensearch-bundle', roleAccount: "${AWS_ACCOUNT_PUBLIC}", duration: 900, roleSessionName: 'jenkins-session') {
s3Upload(bucket: "${ARTIFACT_BUCKET_NAME}", file: sha.lock, path: sha.path)
}
}
withCredentials([
string(credentialsId: 'jenkins-artifact-bucket-name', variable: 'ARTIFACT_BUCKET_NAME'),
string(credentialsId: 'jenkins-aws-account-public', variable: 'AWS_ACCOUNT_PUBLIC')]) {
withAWS(role: 'opensearch-bundle', roleAccount: "${AWS_ACCOUNT_PUBLIC}", duration: 900, roleSessionName: 'jenkins-session') {
s3Upload(bucket: "${ARTIFACT_BUCKET_NAME}", file: sha.lock, path: sha.path)
}
}

}

0 comments on commit 6bb69c0

Please sign in to comment.