Skip to content

Commit c5c3d5e

Browse files
Added Jenkinsfile to Push Docker Image
1 parent 93551af commit c5c3d5e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

JenkinsFileKubernetes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,14 @@ pipeline
3737
sh 'docker build -t 149536451818.dkr.ecr.ap-south-1.amazonaws.com/maven-web-application:${buildNumber} .'
3838
}
3939
}
40+
41+
stage("Authenticate and Push Docker Image to AWS ECR")
42+
{
43+
steps()
44+
{
45+
ss 'aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 149536451818.dkr.ecr.ap-south-1.amazonaws.com'
46+
sh 'docker push 149536451818.dkr.ecr.ap-south-1.amazonaws.com/maven-web-application:${buildNumber}'
47+
}
48+
}
4049
}
4150
}

0 commit comments

Comments
 (0)