For a number of projects I work on I pull in third party tools. Sometimes they’re straight copies - that’s what I inherited in some PHP projects I work on. But in others I use git subtree to pull them in.
However there’s a problem. I need a way to remind myself to check for updates. And generally I like things related to a project to live in the project. For my home projects I use Gitlab and their CI system. The config for which lives in my repo. So why not have the CI system check if the code is out of date?
First step is to script the updates. I have a repo where I store
all my machine configuration which uses three third-party repos.
The script to update it,
This will pull down all changes in these repos and then update a stamp file with the current time. Usually stamp files use the file meta-data to track times, but git doesn’t maintain most file meta-data so the time tracking needs to be a bit more explicit.
All that’s left to do now is have Gitlab’s CI check the stamp file.
.gitlab-ci.yml file this snippet exists:
And inside that script is this snippet:
Now updates are tracked more explicitly in the tree and, due to that, reminders can be driven by the tree. Since the CI system actually manages the deployment and not just testing, this guarantees every six months I’ll at least give a little thought to updating the tools I’m using.