Contents

Blog to Gitlab

First things

I’ve been considering moving camp from GitHub to GitLab for a while. The primary reason is that GitHub is owned by Microsoft and GitLab… isn’t. I figured that the process for generating blog content on one platform wouldn’t be too different on the other, and by and large, I wasn’t disappointed. There were a couple of gotchas that had me scratching my head for a while, but some scouring of the interwebs eventally proved fruitful and I found the solutions.

I’ll be the first to admit that I’m not a stack developer and most of my discovery of Git and Hugo has been in the style of monkey see, monkey do. It’s possible that I missed something along the way that would have helped. Having said that, my stuff does work so hopefully the following is going to be of some use to someone down the line.

Repo & DNS

I created the ‘New Project/Repository’ by choosing ‘Pages/Hugo’ from the drop-down and called it blog.simons.earth, having my own domain to use. I created the CNAME and TXT records on my control panel as requested.

I changed the remote name on my local blog folder and pushed the latest version.

Errors

At this point I started getting errors during the test phase.

1
2
3
4
5
6
7
8
23 Start building sites … 
24 hugo v0.90.1-48907889 linux/amd64 BuildDate=2021-12-10T10:56:41Z VendorInfo=gohugoio
25 ERROR 2021/12/16 18:07:59 Failed to read Git log: Git executable not found in $PATH
26 Error: Error building site: logged 1 error(s)
27 Total in 377 ms
29 Cleaning up project directory and file based variables
00:00
31 ERROR: Job failed: exit code 255

I searched and eventully found a similar error report on the GitLab forum that suggested adding:

1
2
before_script:
  - apk add --update --no-cache git

to the end of the job.

Conclusion

This fixed the error for me and now the commit process works just fine.