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.

  • ToxicWaste@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day 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.