With the goal of building automated deployments, I explored multiple options. The primary ones being Gitlab and Bitbucket since they offer self-hosted options.

My research quickly pointed out that Bitbucket's self-hosted version is an entirely different code base than the cloud offering and anecdotal evidence from articles and comments suggested users had a bad experience with Bitbucket self-hosted version. I must say I haven't evaluated this myself, although I have been a long term user of Bitbucket cloud primarily because they offered private repositories. With Github offering private repositories, that may change.

There was a lot of praise for Gitlab, which has more active development and offers a complete DevOps platform. Previous ventures into implementing it have usually resulted in the overwhelm around setup, but that's perhaps because I haven't really used CI/CD before.

It quickly became apparent that a light weight setup could achieve the outcomes I desire and I don't necessarily have to go with a big horse like Gitlab. There was a mention of Gitea with Drone. Both of which I had never heard of before.

Surprisingly, the setup for Gitea and Drone (server + runner) was really straightforward. However, I ran into some challenges, primarily because of self-hosted air-gapped environment.

The first challenge with drone and gitea was X509 errors. To resolve this, we need the custom root certificate (in my case an internal coroporate authority) to be volume mounted into each of the containers (gitea and drone). This is required because gitea calls a webhook on drone.

Once these challenges were overcome, the next major hurdle was to make drone use docker images that were on my docker host. I quickly came to the conclusion that a private registry was required to make this work with drone, something I had been putting off for a while. A private registry will also be a pre-requisite for automated deployments, as I expect the images build by drone will have to be stored in a registry before they can deployed, at least this is a good practice.

To my surprise again, the setup of the docker registry is pretty simple. My previous perceptions of setting up a registry overestimated complexity quite a bit.

I will be setting up the registry tomorrow and make updates to the post.

Next steps: Private Registry Setup in Production

Private CI using private docker registry with Drone.io (almost free)
. Tagged with docker, drone, rails, testing.

CI/CD workflow using Gitea, Drone and Docker registry