docker-copy.run() docker-copy.modernSCM({$class=GitSCMSource, remote=https://github.com/opensearch-project/opensearch-build-libraries.git}) docker-copy.library({identifier=jenkins@5.2.0, retriever=null}) docker-copy.pipeline(groovy.lang.Closure) docker-copy.timeout({time=30}) docker-copy.echo(Executing on agent [label:none]) docker-copy.stage(Parameters Check, groovy.lang.Closure) docker-copy.script(groovy.lang.Closure) docker-copy.stage(Copy Image to ECR/DockerHub, groovy.lang.Closure) docker-copy.script(groovy.lang.Closure) docker-copy.copyContainer({allTags=false, sourceImage=ci-runner:testtag, sourceRegistry=opensearchstaging, destinationImage=ci-runner:testtag2, destinationRegistry=public.ecr.aws/opensearchstaging}) copyContainer.usernamePassword({credentialsId=jenkins-staging-dockerhub-credential, usernameVariable=DOCKER_USERNAME, passwordVariable=DOCKER_PASSWORD}) copyContainer.withCredentials([[DOCKER_USERNAME, DOCKER_PASSWORD]], groovy.lang.Closure) copyContainer.sh(set +x && echo DOCKER_PASSWORD | docker login --username DOCKER_USERNAME --password-stdin) copyContainer.sh(set +x && aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/opensearchstaging) copyContainer.echo(Copying single image tag from opensearchstaging/ci-runner:testtag to public.ecr.aws/opensearchstaging/ci-runner:testtag2) copyContainer.sh(set -x && crane cp opensearchstaging/ci-runner:testtag public.ecr.aws/opensearchstaging/ci-runner:testtag2) copyContainer.sh(set +x && docker logout && docker logout public.ecr.aws) docker-copy.script(groovy.lang.Closure) docker-copy.postCleanup() postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true}) docker-copy.sh(docker logout && docker logout public.ecr.aws && docker image prune -f --all)