diff --git a/jenkins/docker-ecr/docker-build-with-ecr.jenkinsfile b/jenkins/docker-ecr/docker-build-with-ecr.jenkinsfile index e02b3a254a..a1cc23d1ca 100644 --- a/jenkins/docker-ecr/docker-build-with-ecr.jenkinsfile +++ b/jenkins/docker-ecr/docker-build-with-ecr.jenkinsfile @@ -69,7 +69,7 @@ pipeline { stage('docker-ecr-staging') { steps { script { - copyDockerImage( + copyContainer( sourceImagePath: "opensearchstaging/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationImagePath: "public.ecr.aws/m0o1u6w1/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationType: "ecr", diff --git a/jenkins/docker-ecr/docker-ecr-promote.jenkinsfile b/jenkins/docker-ecr/docker-ecr-promote.jenkinsfile index 729baf44d6..fa214bee3c 100644 --- a/jenkins/docker-ecr/docker-ecr-promote.jenkinsfile +++ b/jenkins/docker-ecr/docker-ecr-promote.jenkinsfile @@ -28,7 +28,7 @@ pipeline { stage('dockerhub-promote-to-prod') { steps { script { - copyDockerImage( + copyContainer( sourceImagePath: "opensearchstaging/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationImagePath: "opensearchproject/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationType: "docker", @@ -40,7 +40,7 @@ pipeline { stage('ecr-promote-to-prod') { steps { script { - copyDockerImage( + copyContainer( sourceImagePath: "opensearchstaging/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationImagePath: "public.ecr.aws/p5f6l6i3/${IMAGE_REPOSITORY}:${IMAGE_TAG}", destinationType: "ecr", diff --git a/tests/jenkins/TestCopyDockerImage.groovy b/tests/jenkins/TestCopyContainerImage.groovy similarity index 66% rename from tests/jenkins/TestCopyDockerImage.groovy rename to tests/jenkins/TestCopyContainerImage.groovy index 7c87ec104c..8af4bdda70 100644 --- a/tests/jenkins/TestCopyDockerImage.groovy +++ b/tests/jenkins/TestCopyContainerImage.groovy @@ -11,18 +11,18 @@ import jenkins.tests.BuildPipelineTest import org.junit.* -class TestCopyDockerImage extends BuildPipelineTest { +class TestCopyContainer extends BuildPipelineTest { @Before void setUp() { - this.registerLibTester(new CopyDockerImageLibTester('opensearchstaging/ci-runner:latest', + this.registerLibTester(new CopyContainerLibTester('opensearchstaging/ci-runner:latest', 'opensearchproject/ci-runner:latest', 'ecr', 'public.ecr.aws/p5f6l6i3', 'DUMMY_ACCOUNT_NAME')) - this.registerLibTester(new CopyDockerImageLibTester('opensearchstaging/ci-runner:latest', + this.registerLibTester(new CopyContainerLibTester('opensearchstaging/ci-runner:latest', 'opensearchproject/ci-runner:latest', 'docker', 'jenkins-staging-docker-prod-token')) @@ -32,6 +32,6 @@ class TestCopyDockerImage extends BuildPipelineTest { @Test public void testForDockerhub() { - super.testPipeline("tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile") + super.testPipeline("tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile") } } diff --git a/tests/jenkins/TestDockerBuildWithEcrJob.groovy b/tests/jenkins/TestDockerBuildWithEcrJob.groovy index 9d97d4f0c7..5e5b455388 100644 --- a/tests/jenkins/TestDockerBuildWithEcrJob.groovy +++ b/tests/jenkins/TestDockerBuildWithEcrJob.groovy @@ -11,7 +11,7 @@ class TestDockerBuildWithEcrJob extends BuildPipelineTest { String accountName = 'aws_account_public' - this.registerLibTester(new CopyDockerImageLibTester("opensearchstaging/${imageRepository}:${imageTag}", + this.registerLibTester(new CopyContainerLibTester("opensearchstaging/${imageRepository}:${imageTag}", "public.ecr.aws/m0o1u6w1/${imageRepository}:${imageTag}", 'ecr', 'public.ecr.aws/m0o1u6w1', diff --git a/tests/jenkins/TestDockerPromoteJob.groovy b/tests/jenkins/TestDockerPromoteJob.groovy index 826d5ed9bd..291be2f443 100644 --- a/tests/jenkins/TestDockerPromoteJob.groovy +++ b/tests/jenkins/TestDockerPromoteJob.groovy @@ -11,13 +11,13 @@ class TestDockerPromoteJob extends BuildPipelineTest { String accountName = 'aws_account_artifact' String sourceImagePath = "opensearchstaging/${imageRepository}:${imageTag}" - this.registerLibTester(new CopyDockerImageLibTester(sourceImagePath, + this.registerLibTester(new CopyContainerLibTester(sourceImagePath, "public.ecr.aws/p5f6l6i3/${imageRepository}:${imageTag}", 'ecr', 'public.ecr.aws/p5f6l6i3', accountName)) - this.registerLibTester(new CopyDockerImageLibTester(sourceImagePath, + this.registerLibTester(new CopyContainerLibTester(sourceImagePath, "opensearchproject/${imageRepository}:${imageTag}", 'docker', 'jenkins-staging-docker-prod-token')) diff --git a/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-build-with-ecr.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-build-with-ecr.jenkinsfile.txt index 14ff1cd009..4f2a9f0de1 100644 --- a/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-build-with-ecr.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-build-with-ecr.jenkinsfile.txt @@ -17,11 +17,11 @@ ) docker-build-with-ecr.stage(docker-ecr-staging, groovy.lang.Closure) docker-build-with-ecr.script(groovy.lang.Closure) - docker-build-with-ecr.copyDockerImage({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=public.ecr.aws/m0o1u6w1/ci-runner-staging:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/m0o1u6w1, accountName=aws_account_public}) - copyDockerImage.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) - copyDockerImage.sh(docker logout) - copyDockerImage.withAWS({role=Upload_ECR_Image, roleAccount=aws_account_public, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) - copyDockerImage.sh( + docker-build-with-ecr.copyContainer({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=public.ecr.aws/m0o1u6w1/ci-runner-staging:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/m0o1u6w1, accountName=aws_account_public}) + copyContainer.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) + copyContainer.sh(docker logout) + copyContainer.withAWS({role=Upload_ECR_Image, roleAccount=aws_account_public, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) + copyContainer.sh( aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/m0o1u6w1 gcrane cp opensearchstaging/ci-runner-staging:latest public.ecr.aws/m0o1u6w1/ci-runner-staging:latest ) diff --git a/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-ecr-promote.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-ecr-promote.jenkinsfile.txt index 553613597e..2729d8735b 100644 --- a/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-ecr-promote.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-ecr-promote.jenkinsfile.txt @@ -6,22 +6,22 @@ docker-ecr-promote.echo(Executing on agent [docker:[image:opensearchstaging/ci-runner:ubuntu2004-x64-docker-buildx0.6.3-qemu5.0-awscli1.22-jdk14, reuseNode:false, stages:[:], args:-u root, alwaysPull:false, containerPerStageRoot:false, label:Jenkins-Agent-al2-x64-c54xlarge-Docker-Host]]) docker-ecr-promote.stage(dockerhub-promote-to-prod, groovy.lang.Closure) docker-ecr-promote.script(groovy.lang.Closure) - docker-ecr-promote.copyDockerImage({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=opensearchproject/ci-runner-staging:latest, destinationType=docker, destinationCredentialIdentifier=jenkins-staging-docker-prod-token}) - copyDockerImage.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) - copyDockerImage.sh(docker logout) - copyDockerImage.usernamePassword({credentialsId=jenkins-staging-docker-prod-token, usernameVariable=DOCKER_USERNAME, passwordVariable=DOCKER_PASSWORD}) - copyDockerImage.withCredentials([[DOCKER_USERNAME, DOCKER_PASSWORD]], groovy.lang.Closure) - copyDockerImage.sh( + docker-ecr-promote.copyContainer({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=opensearchproject/ci-runner-staging:latest, destinationType=docker, destinationCredentialIdentifier=jenkins-staging-docker-prod-token}) + copyContainer.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) + copyContainer.sh(docker logout) + copyContainer.usernamePassword({credentialsId=jenkins-staging-docker-prod-token, usernameVariable=DOCKER_USERNAME, passwordVariable=DOCKER_PASSWORD}) + copyContainer.withCredentials([[DOCKER_USERNAME, DOCKER_PASSWORD]], groovy.lang.Closure) + copyContainer.sh( docker login -u DOCKER_USERNAME -p DOCKER_PASSWORD gcrane cp opensearchstaging/ci-runner-staging:latest opensearchproject/ci-runner-staging:latest ) docker-ecr-promote.stage(ecr-promote-to-prod, groovy.lang.Closure) docker-ecr-promote.script(groovy.lang.Closure) - docker-ecr-promote.copyDockerImage({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=public.ecr.aws/p5f6l6i3/ci-runner-staging:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/p5f6l6i3, accountName=aws_account_artifact}) - copyDockerImage.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) - copyDockerImage.sh(docker logout) - copyDockerImage.withAWS({role=Upload_ECR_Image, roleAccount=aws_account_artifact, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) - copyDockerImage.sh( + docker-ecr-promote.copyContainer({sourceImagePath=opensearchstaging/ci-runner-staging:latest, destinationImagePath=public.ecr.aws/p5f6l6i3/ci-runner-staging:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/p5f6l6i3, accountName=aws_account_artifact}) + copyContainer.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) + copyContainer.sh(docker logout) + copyContainer.withAWS({role=Upload_ECR_Image, roleAccount=aws_account_artifact, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) + copyContainer.sh( aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/p5f6l6i3 gcrane cp opensearchstaging/ci-runner-staging:latest public.ecr.aws/p5f6l6i3/ci-runner-staging:latest ) diff --git a/tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile b/tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile similarity index 92% rename from tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile rename to tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile index f8d5f08cf4..7e64081553 100644 --- a/tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile +++ b/tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile @@ -4,14 +4,14 @@ pipeline { stage('copyImage') { steps { script { - copyDockerImage( + copyContainer( sourceImagePath: 'opensearchstaging/ci-runner:latest', destinationImagePath: 'opensearchproject/ci-runner:latest', destinationType: 'docker', destinationCredentialIdentifier: 'jenkins-staging-docker-prod-token' ) - copyDockerImage( + copyContainer( sourceImagePath: 'opensearchstaging/ci-runner:latest', destinationImagePath: 'opensearchproject/ci-runner:latest', destinationType: 'ecr', diff --git a/tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile.txt b/tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile.txt new file mode 100644 index 0000000000..38a55e3d81 --- /dev/null +++ b/tests/jenkins/jobs/CopyContainer_docker_Jenkinsfile.txt @@ -0,0 +1,22 @@ + CopyContainer_docker_Jenkinsfile.run() + CopyContainer_docker_Jenkinsfile.pipeline(groovy.lang.Closure) + CopyContainer_docker_Jenkinsfile.echo(Executing on agent [label:none]) + CopyContainer_docker_Jenkinsfile.stage(copyImage, groovy.lang.Closure) + CopyContainer_docker_Jenkinsfile.script(groovy.lang.Closure) + CopyContainer_docker_Jenkinsfile.copyContainer({sourceImagePath=opensearchstaging/ci-runner:latest, destinationImagePath=opensearchproject/ci-runner:latest, destinationType=docker, destinationCredentialIdentifier=jenkins-staging-docker-prod-token}) + copyContainer.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) + copyContainer.sh(docker logout) + copyContainer.usernamePassword({credentialsId=jenkins-staging-docker-prod-token, usernameVariable=DOCKER_USERNAME, passwordVariable=DOCKER_PASSWORD}) + copyContainer.withCredentials([[DOCKER_USERNAME, DOCKER_PASSWORD]], groovy.lang.Closure) + copyContainer.sh( + docker login -u DOCKER_USERNAME -p DOCKER_PASSWORD + gcrane cp opensearchstaging/ci-runner:latest opensearchproject/ci-runner:latest + ) + CopyContainer_docker_Jenkinsfile.copyContainer({sourceImagePath=opensearchstaging/ci-runner:latest, destinationImagePath=opensearchproject/ci-runner:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/p5f6l6i3, accountName=DUMMY_ACCOUNT_NAME}) + copyContainer.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) + copyContainer.sh(docker logout) + copyContainer.withAWS({role=Upload_ECR_Image, roleAccount=DUMMY_ACCOUNT_NAME, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) + copyContainer.sh( + aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/p5f6l6i3 + gcrane cp opensearchstaging/ci-runner:latest opensearchproject/ci-runner:latest + ) diff --git a/tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile.txt b/tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile.txt deleted file mode 100644 index 9523c4c81a..0000000000 --- a/tests/jenkins/jobs/CopyDockerImage_docker_Jenkinsfile.txt +++ /dev/null @@ -1,22 +0,0 @@ - CopyDockerImage_docker_Jenkinsfile.run() - CopyDockerImage_docker_Jenkinsfile.pipeline(groovy.lang.Closure) - CopyDockerImage_docker_Jenkinsfile.echo(Executing on agent [label:none]) - CopyDockerImage_docker_Jenkinsfile.stage(copyImage, groovy.lang.Closure) - CopyDockerImage_docker_Jenkinsfile.script(groovy.lang.Closure) - CopyDockerImage_docker_Jenkinsfile.copyDockerImage({sourceImagePath=opensearchstaging/ci-runner:latest, destinationImagePath=opensearchproject/ci-runner:latest, destinationType=docker, destinationCredentialIdentifier=jenkins-staging-docker-prod-token}) - copyDockerImage.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) - copyDockerImage.sh(docker logout) - copyDockerImage.usernamePassword({credentialsId=jenkins-staging-docker-prod-token, usernameVariable=DOCKER_USERNAME, passwordVariable=DOCKER_PASSWORD}) - copyDockerImage.withCredentials([[DOCKER_USERNAME, DOCKER_PASSWORD]], groovy.lang.Closure) - copyDockerImage.sh( - docker login -u DOCKER_USERNAME -p DOCKER_PASSWORD - gcrane cp opensearchstaging/ci-runner:latest opensearchproject/ci-runner:latest - ) - CopyDockerImage_docker_Jenkinsfile.copyDockerImage({sourceImagePath=opensearchstaging/ci-runner:latest, destinationImagePath=opensearchproject/ci-runner:latest, destinationType=ecr, destinationCredentialIdentifier=public.ecr.aws/p5f6l6i3, accountName=DUMMY_ACCOUNT_NAME}) - copyDockerImage.sh({script=test -f /usr/local/bin/gcrane && echo '1' || echo '0' , returnStdout=true}) - copyDockerImage.sh(docker logout) - copyDockerImage.withAWS({role=Upload_ECR_Image, roleAccount=DUMMY_ACCOUNT_NAME, duration=900, roleSessionName=jenkins-session}, groovy.lang.Closure) - copyDockerImage.sh( - aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/p5f6l6i3 - gcrane cp opensearchstaging/ci-runner:latest opensearchproject/ci-runner:latest - ) diff --git a/tests/jenkins/lib-testers/CopyDockerImageLibTester.groovy b/tests/jenkins/lib-testers/CopyContainerLibTester.groovy similarity index 63% rename from tests/jenkins/lib-testers/CopyDockerImageLibTester.groovy rename to tests/jenkins/lib-testers/CopyContainerLibTester.groovy index e9db6937b9..77c7301cbb 100644 --- a/tests/jenkins/lib-testers/CopyDockerImageLibTester.groovy +++ b/tests/jenkins/lib-testers/CopyContainerLibTester.groovy @@ -3,16 +3,20 @@ import static org.hamcrest.CoreMatchers.equalTo import static org.hamcrest.CoreMatchers.notNullValue import static org.hamcrest.MatcherAssert.assertThat -class CopyDockerImageLibTester extends LibFunctionTester { +class CopyContainerLibTester extends LibFunctionTester { - private String sourceImagePath - private String destinationImagePath - private String destinationType - private String destinationCredentialIdentifier - private String accountName + private final String sourceImagePath + private final String destinationImagePath + private final String destinationType + private final String destinationCredentialIdentifier + private final String accountName - public CopyDockerImageLibTester(String sourceImagePath, String destinationImagePath, String destinationType, - String destinationCredentialIdentifier, String accountName=null) { + CopyContainerLibTester( + String sourceImagePath, + String destinationImagePath, + String destinationType, + String destinationCredentialIdentifier, + String accountName=null) { this.sourceImagePath = sourceImagePath this.destinationImagePath = destinationImagePath this.destinationType = destinationType @@ -20,42 +24,46 @@ class CopyDockerImageLibTester extends LibFunctionTester { this.accountName = accountName } - String libFunctionName(){ - return 'copyDockerImage' + String libFunctionName() { + return 'copyContainer' } void configure(helper, binding){ - binding.setVariable('DOCKER_USERNAME', 'dummy_docker_username') binding.setVariable('DOCKER_PASSWORD', 'dummy_docker_password') - helper.registerAllowedMethod("withAWS", [Map, Closure], { args, closure -> + helper.registerAllowedMethod('withAWS', [Map, Closure], { args, closure -> closure.delegate = delegate return helper.callClosure(closure) }) } - void parameterInvariantsAssertions(call){ + void parameterInvariantsAssertions(call) { assertThat(call.args.sourceImagePath.first(), notNullValue()) assertThat(call.args.destinationImagePath.first(), notNullValue()) assertThat(call.args.destinationType.first(), notNullValue()) assertThat(call.args.destinationType.first(), anyOf(equalTo('ecr'), equalTo('docker'))) assertThat(call.args.destinationCredentialIdentifier.first(), notNullValue()) - if(call.args.destinationType.first().toString() == "docker") { - assertThat(call.args.destinationCredentialIdentifier.first(), anyOf(equalTo('jenkins-staging-docker-prod-token'), + if (call.args.destinationType.first().toString() == 'docker') { + assertThat( + call.args.destinationCredentialIdentifier.first(), + anyOf( + equalTo('jenkins-staging-docker-prod-token'), equalTo('jenkins-staging-docker-staging-credential'))) } - if(call.args.destinationType.first().toString() == "ecr"){ + if (call.args.destinationType.first().toString() == 'ecr') { assertThat(call.args.accountName.first(), notNullValue()) - assertThat(call.args.destinationCredentialIdentifier.first(), anyOf(equalTo('public.ecr.aws/p5f6l6i3'), + assertThat(call.args.destinationCredentialIdentifier.first(), + anyOf( + equalTo('public.ecr.aws/p5f6l6i3'), equalTo('public.ecr.aws/m0o1u6w1'))) } } - boolean expectedParametersMatcher(call){ + boolean expectedParametersMatcher(call) { boolean accountNameFound = true - if(call.args.destinationType.first() == "ecr"){ + if (call.args.destinationType.first() == 'ecr') { accountNameFound = call.args.accountName.first().toString() == accountName } diff --git a/vars/copyDockerImage.groovy b/vars/copyContainer.groovy similarity index 59% rename from vars/copyDockerImage.groovy rename to vars/copyContainer.groovy index 8df7eae7e0..d48c21326f 100644 --- a/vars/copyDockerImage.groovy +++ b/vars/copyContainer.groovy @@ -1,20 +1,29 @@ -void call(Map args = [:]){ - +/**@ + * Copies a container from one docker registry to another + * + * @param args A map of the following parameters + * @param args.sourceImagePath The url to the image to be copied from, supports any public docker registry + * @param args.destinationImagePath Follows the format NAME[:TAG|@DIGEST], e.g. opensearchproject/opensearch:1.2.4 + * @param args.destinationType The docker registry, currently supports 'docker' or 'ecr' + * @param args.destinationCredentialIdentifier The credential identifier registered in the jenkins system associated with the NAME + * @param args.accountName Only used for the 'ecr' registry, the AWS role to assume + */ +void call(Map args = [:]) { res = sh(script: "test -f /usr/local/bin/gcrane && echo '1' || echo '0' ", returnStdout: true).trim() - if(res == '0') { + if (res == '0') { install_gcrane() } - sh "docker logout" + sh 'docker logout' - if(args.destinationType == 'docker'){ + if (args.destinationType == 'docker') { withCredentials([usernamePassword(credentialsId: args.destinationCredentialIdentifier, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) { sh """ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD gcrane cp ${args.sourceImagePath} ${args.destinationImagePath} """ } - } else if(args.destinationType == 'ecr'){ + } else if (args.destinationType == 'ecr') { withAWS(role: 'Upload_ECR_Image', roleAccount: "${args.accountName}", duration: 900, roleSessionName: 'jenkins-session') { sh """ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${args.destinationCredentialIdentifier} @@ -24,7 +33,7 @@ void call(Map args = [:]){ } } -void install_gcrane(){ +void install_gcrane() { sh''' curl -L https://github.com/google/go-containerregistry/releases/latest/download/go-containerregistry_Linux_x86_64.tar.gz \\ -o go-containerregistry.tar.gz