//
you're reading...
Uncategorized

Updating Gitlab with Docker

Just a brief on a recent adventure using Docker to update Gitlab.

As Ops, we decided to run our own Gitlab server, mainly to track our cookbooks for releases, but also for scripts, load balancer configs, etc…

Since we are so interrupt driven, we didn’t really update Gitlab regularly and it got pretty far behind, we are using 6.2.0 and current stable is 7.5.1

I needed a way to update, but I also didn’t want to risk a long downtime if things went sideways.

Docker to the rescue. I started playing more and more with Docker, mainly for learning some rails stuff, but the company also has some interest in using it for some future projects, one of the reasons we used OpenStack.

So first thing I did was build a container running the same version of Gitlab with a restored backup, this took a bit of figuring out to do, but once I got right I was able to consistently run the container with a restored backup, I could login and browse code and everything. I was very happy about that.

From there I created a new container from the previous one that updates Gitlab.

So far it’s working nicely, I’m able to login to the updated version of Gitlab and test changes.

A couple things I ran into:

  • In order to restore a backup of Gitlab, the version for Gitlab has to be exact, not just the branch but the actual ref number.

    For me, I did the following:

    git clone https://github.com/gitlabhq/gitlabhq -b v6.2.0 gitlab
    cd gitlab
    git checkout -b v6.2.0 5123d706c217a7307f512ca922aa8862914e1d6c
    
  • Had to give git user sudo NOPASSWD access

    While this isn’t ideal, it was needed to run bundle install.

  • Some Gems won’t be found, I had to download them and then install them via Docker
  • Some RPMs won’t be found, I had to download them and then install them via Docker

I’m going to commit the Docker files and scripts here:

docker-gitlab-update

Advertisements

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s