This script is executed regularly in our Kubernetes cluster to trigger builds for snaps that:
- Parts dependencies defined in the snapcraft.yaml were changed (Only the ones that are GitHub repos)
- The snap GitHub repo itself was changed since the last build.
This script is a Python version of the old javascript script.
All the script does is:
- Get all the snaps created with the build.snapcraft.io user, and for each repo, it will:
- Verify the content in the repo:
- There is a snapcraft.yaml
- The snap name in the snapcraft.yaml is valid
- Get the date of the last built and skip if the snap was built in the previous 24h
- Trigger a build if any of the following condition happen:
- Repository of the snap has changed after the last built.
- Any of the GitHub repos from the parts defined in the snapcraft.yaml has changed since the last build.