Gitlab CI runner installation

The instructions to install GitLab CI runner are adapted to Ubuntu 14.04 to connect to GitLab CI and run jobs when a commit is pushed to a branch.

A runner token must be obtained from GitLab CI, at the URL for instance.

The gitlab-ci-multi-runner/ is installed as follows:

$ curl -L | sudo bash
$ sudo apt-get install gitlab-ci-multi-runner
$ $ sudo gitlab-ci-multi-runner register
Please enter the gitlab-ci coordinator URL (e.g.
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this runner:
[cong]: runner1
INFO[0156] 4418775e Registering runner... succeeded
Please enter the executor: shell, parallels, docker, docker-ssh, ssh:
[shell]: docker
Please enter the Docker image (eg. ruby:2.1):
If you want to enable mysql please enter version (X.Y) or enter latest?

If you want to enable postgres please enter version (X.Y) or enter latest?

If you want to enable redis please enter version (X.Y) or enter latest?

If you want to enable mongo please enter version (X.Y) or enter latest?

INFO[0281] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

It is configured to run each job in a golang docker container. The project git repository is expected to have a .gitlab-ci.yml file at the root. For instance if .gitlab-ci.yml was:

  script: "type go"

the GitLab runner would succeed with:

One Reply to “Gitlab CI runner installation”

  1. Hey, I was successful getting this runner running thanks to your post 🙂

    But I am struggling with an issue regarding my GOPATH.

    My .gitlab-ci.yml looks like:

    - go get

    - build
    - test

    stage: build
    - GOPATH=`godep path`:$GOPATH
    - go get --insecure
    - godep restore

    stage: test
    script: make test

    But when running the test, the result looks like:

    gitlab-ci-multi-runner 0.5.5-1-g69bc934 (69bc934)
    Using Docker executor with image golang:latest ...
    Running on runner-84683b96-project-1-concurrent-0 via gitlab...

    Cloning repository...
    Cloning into '/builds/mygroup/go-testrepo'...
    Checking out aed9bf9f as master...

    $ go get
    $ GOPATH=`godep path`:$GOPATH
    $ go get --insecure
    go install: no install location for directory /builds/mygroup/go-testrepo outside GOPATH
    For more details see: go help gopath

    ERROR: Build failed with: exit code 1

    I already tried adding $CI_PROJECT_DIR to my GOPATH and also copying my repo to $GOPATH/src/mygroup/go-testrepo, but nothing worked.

    Do you have another suggestion what I could try here? :/

Comments are closed.