This is still in progress…
GitLab comes with Continuous Integration support. We do have to setup a Runner to run the CI job. Runner is basically a daemon that runs on a server that executes the CI job.
GitLab supports Debian, Ubuntu and CentOS.
We will setup the runner on Ubuntu 16.04 server.
ssh into the server.
- Add GitLab’s official repository via yum:
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-ci-multi-runner
- Register the runner:
sudo gitlab-ci-multi-runner register
In order to use GitLab’s continuous integration, we have to
- add a
.gitlab-ci.ymlfile to the root directory of the app
- configure the GitLab project to use a Runner.
After that each merge request or push triggers CI.
First make sure there is a
.ruby-version file at the root of the app with the ruby version you want to use.
touch .ruby-version echo "2.3.1" > .ruby-version
.gitlab-ci.yml at the root of the rails app
If you are using
rspec for testing, update the above file with:
minitest is used, update as below:
Configuring a Runner
Runners run the builds that are defined in
.gitlab-ci.yml. Runner can be virtual machine, docker container etc.
Two steps are involved
- Install it
- Configure it