<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>ci &amp;mdash; cos</title>
    <link>https://apintandaparma.club/cos/tag:ci</link>
    <description></description>
    <pubDate>Thu, 23 Apr 2026 14:52:18 +0000</pubDate>
    <item>
      <title>gitlab-ci-tools</title>
      <link>https://apintandaparma.club/cos/gitlab-ci-tools</link>
      <description>&lt;![CDATA[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&#39;m trying to spend time away from the desk that I use for Working from Home, I&#39;m using my iPad a lot. If I&#39;m doing something like making some DNS changes in my Gitlab-managed zone files, I don&#39;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.&#xA;&#xA;Yesterday evening I hacked up something to check the status of a given gitlab org/repo.&#xA;&#xA;!--more --&#xA;&#xA;It started simple:&#xA;&#xA;% gitlab-ci-status org/repo&#xA;running&#xA;&#xA;[ ... time passes ... ]&#xA;&#xA;% gitlab-ci-status org/repo&#xA;success&#xA;&#xA;I quickly added support for:&#xA;&#xA;automagically guessing the org/repo from wherever you are (is there an &#34;origin&#34; remote? where does it point to? is it our gitlab server?).&#xA;fetching the API token from gopass.&#xA;&#xA;This morning I added a second script to wait until the pipeline has &#34;finished&#34;, and print a useful message:&#xA;&#xA;% gitlab-ci-status -v&#xA;success for some-org/local-dns in 26 seconds at Sun 12 Jul 2020 10:14:22 AEST&#xA;&#xA;Being a one-night-and-one-morning invention I&#39;ve taken a few liberties that I&#39;ll try and resolve over time:&#xA;&#xA;I didn&#39;t test it anywhere other than Linux yet (and I used GNU date somewhere as a quick/lazy solution to something).&#xA;You can imagine that I haven&#39;t tested too much beyond the &#34;happy path&#34;.&#xA;&#xA;Later on I&#39;ll hook it up to either:&#xA;&#xA;tell Emacs to tell me it&#39;s done, or&#xA;some kind of push notification thingo. (done: see the -n option.) &#xA;&#xA;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.&#xA;&#xA;I hope it&#39;s useful to somebody!&#xA;&#xA;https://gitlab.com/ajcos/gitlab-ci-tools&#xA;&#xA;#gitlab #shell #cli #ci #nerdery #linux&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;p class=&#34;sig&#34;This was a post from a href=&#34;https://andrew.j.cosgriff.name/&#34;Cos/a./p&#xD;&#xA;&#xD;&#xA;p class=&#34;sig&#34;You can follow this blog on the Fediverse at code@cos@apintandaparma.club/code or a href=&#34;https://apintandaparma.club/cos/feed&#34;subscribe in your RSS reader/a./p&#xD;&#xA;&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>I use <a href="https://gitlab.com" rel="nofollow">Gitlab</a> 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&#39;m trying to spend time away from the desk that I use for Working from Home, I&#39;m using my iPad a lot. If I&#39;m doing something like making some DNS changes in my Gitlab-managed zone files, I don&#39;t want to have to context-switch out of my <a href="https://blink.sh" rel="nofollow">lovely full-screen terminal</a> to a web browser to check if the changes have finished deploying.</p>

<p>Yesterday evening I hacked up something to check the status of a given gitlab org/repo.</p>



<p>It started simple:</p>

<pre><code class="language-shell">% gitlab-ci-status org/repo
running

[ ... time passes ... ]

% gitlab-ci-status org/repo
success
</code></pre>

<p>I quickly added support for:</p>
<ul><li>automagically guessing the org/repo from wherever you are (is there an “origin” remote? where does it point to? is it our gitlab server?).</li>
<li>fetching the API token from <a href="https://www.gopass.pw" rel="nofollow">gopass</a>.</li></ul>

<p>This morning I added a second script to wait until the pipeline has “finished”, and print a useful message:</p>

<pre><code class="language-shell">% gitlab-ci-status -v
success for some-org/local-dns in 26 seconds at Sun 12 Jul 2020 10:14:22 AEST
</code></pre>

<p>Being a one-night-and-one-morning invention I&#39;ve taken a few liberties that I&#39;ll try and resolve over time:</p>
<ul><li>I didn&#39;t test it anywhere other than Linux yet (and I used GNU <code>date</code> somewhere as a quick/lazy solution to something).</li>
<li>You can imagine that I haven&#39;t tested too much beyond the “happy path”.</li></ul>

<p>Later on I&#39;ll hook it up to either:</p>
<ul><li>tell Emacs to tell me it&#39;s done, or</li>
<li><del>some kind of push notification thingo.</del> (done: see the <code>-n</code> option.)</li></ul>

<p>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.</p>

<p>I hope it&#39;s useful to somebody!</p>

<p><a href="https://gitlab.com/ajcos/gitlab-ci-tools" rel="nofollow">https://gitlab.com/ajcos/gitlab-ci-tools</a></p>

<p><a href="/cos/tag:gitlab" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">gitlab</span></a> <a href="/cos/tag:shell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">shell</span></a> <a href="/cos/tag:cli" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">cli</span></a> <a href="/cos/tag:ci" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ci</span></a> <a href="/cos/tag:nerdery" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">nerdery</span></a> <a href="/cos/tag:linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">linux</span></a></p>

<hr>

<p class="sig">This was a post from <a href="https://andrew.j.cosgriff.name/" rel="nofollow">Cos</a>.</p>

<p class="sig">You can follow this blog on the Fediverse at <code><a href="https://apintandaparma.club/@/cos@apintandaparma.club" class="u-url mention" rel="nofollow">@<span>cos@apintandaparma.club</span></a></code> or <a href="https://apintandaparma.club/cos/feed" rel="nofollow">subscribe in your RSS reader</a>.</p>
]]></content:encoded>
      <guid>https://apintandaparma.club/cos/gitlab-ci-tools</guid>
      <pubDate>Sun, 12 Jul 2020 03:22:31 +0000</pubDate>
    </item>
  </channel>
</rss>