this post was submitted on 24 Jan 2025
8 points (83.3% liked)

Selfhosted

41554 readers
630 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I am wanting to automate some homelab things. Specifically deploying new and updating existing docker containers.

I would like to publish my entire docker compose stacks (minus env vars) onto a public Git repo, and then using something to select a specific compose from that, on a specific branch (so I can have a physical seperate server for testing) automatically deploy a container.

I thought of Jenkins, as it is quite flexable, and I am very willing to code it together, but are there any tools like this that I should look into instead? I've heard Ansible is not ideal for docker compose.

you are viewing a single comment's thread
view the rest of the comments
[–] ToxicWaste@lemm.ee 1 points 4 days ago

as @damnthefilibuster@lemmy.world already mentioned: GitLab CI

Jenkins is a CI application from before CI was cool. GitLab CI is integrated and can trigger on certain events. Additionally you mentioned, that you want to publish on a public repo anyway.

You are probably are comfortable with containers. So GitLab CI should be easy for you to learn - as it pretty much starts up a container to do certain tasks. I've seen suggestions for Kubernetes, which for sure is the more mature solution. But i would question, whether you need the added functionality and complexity of K8s for a home setup.

To gain access to your local network, you can use the runner for a secure connection (as described by damnthefilibuster). or you could SSH into the machine, as long as you have it in a DMZ. Drawback is that you have to be more sure about your network infrastructure. Benefit is that it is a more general approach. Obviously you need to store all certs, keys and preferably even addresses in secrets, not the .gitlab-ci.yml.

As you can see from this thread, there are many ways which lead to rome. My advice is to start with something simple and lightweight, which you understand. adding complexity down the road is easier, than removing it.