From 69f70c0388fa258b9b0379ee610ac7cec2a0f4bd Mon Sep 17 00:00:00 2001 From: s4616 <87678241+s4616@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:07:19 +0900 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7219f0412..a2fcfb302 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,7 +37,14 @@ pipeline { } stage('Push Docker Image') { steps { - echo "Push Docker Image to ECR" + echo "Push Docker Image to ECR" + script { + // cleanup current user docker credentials + sh 'rm -f ~/.dockercfg ~/.docker/config.json || true' + docker.withRegistry("https://257307634175.dkr.ecr.ap-northeast-2.amazonaws.com", "ecr:ap-northeast-2:AWSCredentials") { + docker.image("aws00-spring-petclonic:latest").push() + } + } } } stage('Upload to S3') {