Skip to content

Commit

Permalink
Cirrus: Never run prune on other branches
Browse files Browse the repository at this point in the history
This is needed because the prune container image will be built from
other branches as they are made.  If the behavior of this or the imgts
image diverges from that of master, random VM images could be "cleaned"
unexpectedly.  By hard-coding this task to the master branch only,
it should never run anywhere else.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich authored and snj33v committed May 31, 2020
1 parent 99de114 commit 3937f9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ meta_task:
# Remove old and disused images based on labels set by meta_task
image_prune_task:

# Do not run this frequently
only_if: $CIRRUS_BRANCH == $DEST_BRANCH
# This should ONLY ever run from the master branch, and never
# anywhere else so it's behavior is always consistent, even
# as new branches are created.
only_if: $CIRRUS_BRANCH == "master"

depends_on:
- "meta"
Expand Down

0 comments on commit 3937f9c

Please sign in to comment.