Skip to content

Instantly share code, notes, and snippets.

@pietsch
Last active February 17, 2016 10:35
Show Gist options
  • Save pietsch/a74f810277a52f3a0fb9 to your computer and use it in GitHub Desktop.
Save pietsch/a74f810277a52f3a0fb9 to your computer and use it in GitHub Desktop.
How to install GitLab CI on openSUSE 12.3 GNU/Linux

Installing GitHub CI 5.0 on openSUSE 12.3

Although this GNU/Linux distro is not supported, were are already running GitLab on an openSUSE server, so let's see if we can set up a GitLab CI (Continuous Integration) server on openSUSE, too. These notes are basically a translation of http://doc.gitlab.com/ci/install/installation.html to SuSE. See also other unofficial GitLab installation guides: https://github.com/gitlabhq/gitlab-public-wiki/wiki/Unofficial-Installation-Guides

1. Packages / Dependencies

Installing the prerequisites is already a hassle, but I was able to map most of the Debian package names to SuSE's naming scheme using distromatch. So here we go:

sudo ln -s /usr/bin/vi /usr/local/bin/editor  ## give your favourite text editor a standard name
sudo zypper install --type pattern devel_basis
sudo zypper install wget curl checkinstall libxml2-devel libxslt-devel libcurl-devel readline-devel glibc-devel libopenssl-devel libmysqlcppconn-devel make libz1 openssh git-core libyaml-devel postfix postgresql-devel libicu-devel
sudo zypper install redis

To get redis up, some manual work is needed:

sudo cp /etc/redis/default.conf.example /etc/redis/default.conf
sudo chown redis:redis /etc/redis/default.conf
sudo rcredis start; sudo insserv redis

2. Ruby

For Ruby, either follow the original instructions: http://doc.gitlab.com/ci/install/installation.html#ruby … but then you will need this dirty workaround to make rake work later on:

sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

So if you can install Ruby 2.0 from a system package, I would recommend this instead:

sudo zypper install ruby2.0 ruby2.0-dev

3. GitLab CI user:

sudo useradd --create-home --comment 'GitLab CI' gitlab_ci

3. Prepare the database

Install your favourite MySQL implementation like this:

sudo zypper install mariadb libmysqlclient-devel
sudo systemctl start mysql
sudo insserv mysql
mysql -u root

From here on, just follow the original instructions: http://doc.gitlab.com/ci/install/installation.html#prepare-the-database

7. Install Init Script

sudo cp /home/gitlab_ci/gitlab-ci/lib/support/init.d/gitlab_ci /etc/init.d/gitlab_ci
sudo insserv gitlab_ci
sudo /etc/init.d/gitlab_ci start

8. Nginx

sudo zypper install nginx
sudo mkdir /etc/nginx/vhosts.d
sudo cp /home/gitlab_ci/gitlab-ci/lib/support/nginx/gitlab_ci /etc/nginx/vhosts.d/gitlab_ci.conf
sudo editor /etc/nginx/vhosts.d/gitlab_ci.conf  ## set your server_name

GitHub CI Runner on openSUSE 12.3

To actually build your projects, you need one or more runners. Looking at the official instructions for Debian-based systems https://gitlab.com/gitlab-org/gitlab-ci-runner/blob/master/README.md you will notice that you need the same system packages as dependencies, so see 1. above on how to install these on openSUSE.

In my case, the bundle install --deployment step failed to install the charlock_holmes gem (version 0.6.9.4) due to messed up lib vs. lib64 paths. My workaround was to install the current version instead:

sed -i s/0.6.9.4/0.7.3/ /home/gitlab_ci_runner/gitlab-ci-runner/Gemfile*
@vpeil
Copy link

vpeil commented Aug 7, 2014

Nice job! Thanks for the notes.

@danogwok
Copy link

danogwok commented Sep 1, 2015

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment