Skip to content

Commit

Permalink
allow pr image expiration to be adjustable (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
drodowic authored Feb 3, 2022
1 parent 7137f84 commit 4d1cd03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#IMAGE="quay.io/myorg/myapp" -- docker image URI to push to
#DOCKERFILE=Dockerfile.custom -- dockerfile to use (optional)
#CACHE_FROM_LATEST_IMAGE=true -- build image from cache from latest image (optional)
: ${QUAY_EXPIRE_TIME:="3d"} # sets a time to expire from when the image is built

# Env vars set by bootstrap.sh:
#IMAGE_TAG="abcd123" -- image tag to push to
Expand All @@ -28,7 +29,7 @@ function build {

# if this is a PR, set the tag to expire in 3 days
if [ ! -z "$ghprbPullId" ] || [ ! -z "$gitlabMergeRequestIid" ]; then
echo "LABEL quay.expires-after=3d" >> $APP_ROOT/$DOCKERFILE
echo "LABEL quay.expires-after=${QUAY_EXPIRE_TIME}" >> $APP_ROOT/$DOCKERFILE
fi

if test -f /etc/redhat-release && grep -q -i "release 7" /etc/redhat-release; then
Expand Down

0 comments on commit 4d1cd03

Please sign in to comment.