Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit 48945e5

Browse files
committed
PJL-2986: Create repo if it does not exist
1 parent 29e2bbf commit 48945e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ node {
1313
stepsForParallel["Postgres ${version}"] = {
1414
stage("Postgres ${version}"){
1515
def ver = "${version}".replace(".", "")
16+
// Pull the latest image so we have a record of the sha
1617
sh "docker pull 723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}:latest || true"
18+
1719
sh "docker build -t '723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}' ${version}/"
1820
if (env.BRANCH_NAME == 'master') {
21+
//# Try to create the repository so the push doesn't fail
22+
sh "aws ecr create-repository --repository-name postgres${ver} || true"
23+
1924
sh "docker push 723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}:latest"
2025
}
2126
}

0 commit comments

Comments
 (0)