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
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
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
sudo useradd --create-home --comment 'GitLab CI' gitlab_ci
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
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
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
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*
thanks