[Question] How can I watch a remote repository for changes and trigger a build?
There's a project I'm watching and I'd like to have my mac automatically build the updates as the come in the background so that I always have the latest version. I tried searching but I didn't get the results I was looking for.
Posted Feb 21, 2020, 7:02 PM UTC
To verify: it's an upstream project you have nothing to do with?
Set up a simple cron-job to
git pull && buildevery day/hour/x min. (doubt there's even a fundamentally different solution). Ideally with some automated testing before installing, so you don't end up with a bad version.You can also check if there's a build-script for this software in Archlinux/AUR where dou can copy some commands.
Correct. no connection. It's a friend's app that I'm testing on occasion. I don't feel like checking to see if there's a new version.
The problem with the cron job is that it always builds even if there's no new version. I guess it works, but it's not optimal. I know there are triggers because CI/CD pipelines can trigger on build
Sorry, I thought git pull had error codes, hence the
&&. So run a git fetch first and check if there are changes. StackOverflow is your friend here. Same commit hash of master and origin/master would be the simplest I guess. Or check if your shell has git integration so you can read out this info (fish has by default, for bash and zsh there are plugins). Or grep the git pull output for "already up-to-date".Usually CI pipelines trigger on commit (git pre/post commit hooks) and are installed on the hosting server.
Ok, thanks for your help with this. Now I have some bullets to shoot with