Greymeister.net

YAGNI Jenkins Edition

I’ve been working on what I mentioned last time WRT updating my website. The first step I’ve taken was preparing to migrate to a new webserver. I’ll detail what I’m using to do that, but this post is about simplifying things, and one of the simplest things I use is make.

Software people, especially those that work on webshits, love complexity. I don’t mean that they necessarily seek it out but it seems like many find using the latest big pile of code irresistible. Unfortunately, build systems have not escaped this. Now, not all of them have been accused of ”russian hacks” by ignorant people, but they have real annoyances all their own. I’ve used several myself and they’ve all been painful. The least painful solution I have opted for recently was Jenkins but even it’s gone all ”enterprisey” it seems. Between trying to sift through dozens of Jenkinsfile groovy hacks and the unintelligible Job DSL that I deal with at work, the last thing I wanted to do was deal with that at home.

Rage Gohan, pure rage

So when it was time to set up some basic structure for deploying my site, I was determined not to bring a CI system into the mix. Sure, it wouldn’t be “fully-automated” but it would be hardly worth doing that for an infrequently updated blog. People getting fixated on “automating everything” even for things that really don’t deserve it is another strange affliction I’ve noticed. Remember when Boxen was a thing people wanted to opt into? Gee whiz mister, sure, let me have your ”solution” to IT on my personal machine, that’ll be a blast. Oh wait, you stopped supporting it? Whoops!

All I needed was a consistent storage mechanism for the tarball that I build from my blog source. Having older versions available for any oopsies would be great too. I ended up using the following:

Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
reposrv := foo
repodir := /bar
version := $(shell date +"%Y%m%d%H%M%S")

all: public.tar.gz

public.tar.gz:
  rake clean generate
  tar -C public/ -czf public.tar.gz .

upload: public.tar.gz  
  scp public.tar.gz ${reposrv}:${repodir}/public.${version}.tar.gz
  ssh ${reposrv} "cd ${repodir} && rm -f public.latest.tar.gz && ln -s public.${version}.tar.gz public.latest.tar.gz"

clean:
  rake clean
  rm -f public.tar.gz

As you can see, it’s pretty simple. After I build I push a copy to a location that is available via HTTP (in this case, it was an empty WebDav share on my FreeNasTrueNas machine). I then make a symlink to the latest version (the one I just uploaded) so that I have a consistent location to pull the tarball from. It’s very simple and I doubt I will have to redesign it everytime someone decides to go all CADT on something I have the misfortune of using. Cleaning up old builds would be something I could do as part of the Makefile or just as a 🌽tab later.

I’ll have more on what I’m using to set up my new servers soon and oh boy is it more complicated than I wanted.