Introduction

GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.

Prerequisites

Instructions

This section describes how to install and configure GitLab runner using docker on some server.

  1. Deploy virtual server in Portal

    Skip this step if you already have a server. 

    If you need new server, you can deploy one via TDS portal - Orchestration - Servers#Howtodeploynewserver


  2. Install Docker engine on server – choose one of the following options
  3. Start docker container with latest version of gitlab runner (official instructions)

    docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest


  4. Configure GitLab runner to connect to your repository
    1. In your GitLab repository, go to Settings → CI/CD → Runners
    2. You will need URL and "registration token" from "Set up a specific runner for a project" section
    3. Execute following command on the server with running docker container

      docker exec -it gitlab-runner gitlab-runner register --docker-privileged


    4. You will be prompted to fill-in following parameters:
      1. URL from step 4.b.
      2. Token from step 4.b.
      3. Description
      4. Tags for the runner (can leave this blank for the moment).
      5. Specify docker executor
      6. Specify a default Docker image (e.g. alpine:latest)