This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script manages a simple tagging lifecycle: current -> previous -> outdated. | |
# It is meant to be used with a bucket lifecycle policy, in order to delete all outdated tags. | |
# Why ? | |
# The deployment bucket has to be cleaned regularly, otherwise it will become a mess. | |
# However, having a simple lifecycle policy based on time is dangerous | |
# Deleting old objects without a recent deployment can lead to deletion of currently used assets. | |
# In case of error in the next deployment, the stack will try to rollback and will not find assets |