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') {