I use Gitlab at home for a bevy of personal things, and find the built-in CI really handy for further automating changes to my network. Now that I’m trying to spend time away from the desk that I use for Working from Home, I’m using my iPad a lot. If I’m doing something like making some DNS changes in my Gitlab-managed zone files, I don’t want to have to context-switch out of my lovely full-screen terminal to a web browser to check if the changes have finished deploying.
Yesterday evening I hacked up something to check the status of a given gitlab org/repo. It started simple:
% gitlab-ci-status org/repo running [ ... time passes ... ] % gitlab-ci-status org/repo success
I quickly added support for:
- automagically guessing the org/repo from wherever you are (is there an “origin” remote? where does it point to? is it our gitlab server?).
- fetching the API token from gopass.
This morning I added a second script to wait until the pipeline has “finished”, and print a useful message:
% gitlab-ci-status -v success for some-org/local-dns in 26 seconds at Sun 12 Jul 2020 10:14:22 AEST
Being a one-night-and-one-morning invention I’ve taken a few liberties that I’ll try and resolve over time:
- I didn’t test it anywhere other than Linux yet (and I used GNU
datesomewhere as a quick/lazy solution to something).
- You can imagine that I haven’t tested too much beyond the “happy path”.
Later on I’ll hook it up to either:
- tell Emacs to tell me it’s done, or
some kind of push notification thingo.(done: see the
The first part of this I remember writing a very simple version for, for one particular Jenkins pipeline I worked on a lot, back in the days when I was still a sysadmin in my day job. Now, I just do this for fun.
I hope it’s useful to somebody!