Skip to content

Commit

Permalink
Prevent latest image from being overwritten by old releases
Browse files Browse the repository at this point in the history
  • Loading branch information
woop committed Jun 12, 2020
1 parent 1aec92d commit 53cc46a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .prow/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,18 @@ postsubmits:
--file infra/docker/serving/Dockerfile \
--google-service-account-file /etc/gcloud/service-account.json
docker tag gcr.io/kf-feast/feast-core:${PULL_BASE_REF:1} gcr.io/kf-feast/feast-core:latest
docker push gcr.io/kf-feast/feast-core:latest
docker tag gcr.io/kf-feast/feast-serving:${PULL_BASE_REF:1} gcr.io/kf-feast/feast-serving:latest
docker push gcr.io/kf-feast/feast-serving:latest
HIGHEST_SEMVER_TAG=$(git tag -l --sort -version:refname | head -n 1)
echo "Only push to latest tag if tag is the highest semver version $HIGHEST_SEMVER_TAG"
if [ "${PULL_BASE_REF:1}" == "${HIGHEST_SEMVER_TAG:1}" ]
then
docker tag gcr.io/kf-feast/feast-core:${PULL_BASE_REF:1} gcr.io/kf-feast/feast-core:latest
docker push gcr.io/kf-feast/feast-core:latest
docker tag gcr.io/kf-feast/feast-serving:${PULL_BASE_REF:1} gcr.io/kf-feast/feast-serving:latest
docker push gcr.io/kf-feast/feast-serving:latest
fi
fi
volumeMounts:
Expand Down

0 comments on commit 53cc46a

Please sign in to comment.