forgejo Actions (for Shugits)

I have been using forgejo with Mercurial (hg) - the two pair well together when using my tool “shugits” to connect them. This post is a rambling discussion of how I enabled CI for this Hugo blog.


Using a “like-Hub” server eases certain intellectual burdens, making development (and project management) simpler. Being able to spin up a new repo on a whim, and knowing that there’s a backup for the whole thing, makes fragmenting projects into smaller things less tedious.

The next goal would be a simple-to-use continuous integration system for projects - which never was Jenkins’ (or Hudson’s) strength.

I started with Woodpecker but struggled with some permission and connection issues. Despite my best efforts, I couldn’t get Woodpecker’s agents to connect to the Woodpecker server via http:// across my local network. Some tedious suggestion on ChatGPT involved using forgejo’s built-in CI to solve the problem.

I was not aware that forgejo had a built-in CI - why are we all excited about Woodpecker and Drone if there’s a built-in one?

The system uses one’s server as the CI server but requires the conventional approach of setting up agents and connecting them to the server. I’m running an old forgejo image but found that the latest GitTea Windows client worked fine. I used a simple setup and got a trivial pipeline going with my Windows 10 PC as the agent. Once this ran, I deleted it and celebrated a PoC.

Getting a docker container on the Pi3 (thanks again, Sam!) running was rather simple - I needed to set a docker image and double-check my labels, but it worked as expected.

The long and tedious process was adapting my .bat files to run on Linux hosts. Iterating on the CI script required re-committing with more logging in the script; a dull process. Source Hut’s System keeps failed CI jobs around so one can connect to them via SSH and explore - I missed this feature here. Eventually, I used Python scripts for the more tedious parts of the pipeline - this solved the problem I was having. Specifically, I wanted to clone an unrelated git repo, delete the contents of the repo, and replace those contents - shell and CI scripts seemed to constantly do something a little bit wrong.

So.

Forgejo has had a CI system as of 2023-02-27 which uses distributed worker agents. The agents need “docker access,” but the newer clients can run with older servers. The jobs themselves are run in Docker containers, which makes debugging them tedious - I found the easiest solution was to use Python scripts in the project tree rather than elaborate workflow pipelines. The next steps (for me) would be to automate my testing and pushing to public hosts like GitHub as a precursor to working with something like SonarQube.

comments powered by Disqus
Peter LaValle avatar
Peter LaValle
Any links probably include affiliate ids for that sweet sweet kickback - and some programs require that I tell you. The contents of this blog are likely unrelated - as they include games, paints, and build tools.