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

Commit

Permalink
PJL-2986: Create repo if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
edquan committed Nov 6, 2020
1 parent 29e2bbf commit 137a4d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ node {
stepsForParallel["Postgres ${version}"] = {
stage("Postgres ${version}"){
def ver = "${version}".replace(".", "")
# Pull the latest image so we have a record of the sha
sh "docker pull 723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}:latest || true"

sh "docker build -t '723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}' ${version}/"
if (env.BRANCH_NAME == 'master') {
# Try to create the repository so the push doesn't fail
sh "aws ecr create-repository --repository-name postgres${ver} || true"
sh "docker push 723151894364.dkr.ecr.us-east-1.amazonaws.com/postgres${ver}:latest"
}
}
Expand Down

0 comments on commit 137a4d2

Please sign in to comment.