Add gitlab-runner in docker-swarm mode

How add gitlab runner to gitlab in swarm mode(fuck kubernetes).
Create docker-compose.yml

Deploy to swarm

Add runner to gitlab.
1. Obtain a token for a shared or specific Runner via GitLab’s interface

2. Register runner
Docker
To register a Runner using a Docker container:

Run the following command:

Enter your GitLab instance URL:

Enter the token you obtained to register the Runner:

Enter a description for the Runner, you can change this later in GitLab’s UI:

Enter the tags associated with the Runner, you can change this later in GitLab’s UI:

Choose whether the Runner should pick up jobs that do not have tags, you can change this later in GitLab’s UI (defaults to false):

Choose whether to lock the Runner to the current project, you can change this later in GitLab’s UI. Useful when the Runner is specific (defaults to true):

If you chose Docker as your executor, you’ll be asked for the default image to be used for projects that do not define one in .gitlab-ci.yml:

3. Save config persist

4. Unncomment line in docker-compose.yml

5. Change line in config config.toml

6. My gitlabrunner config.toml file as example

I set custom dns serveer and increase running job at once to 10.
Profit.

Добавить комментарий

Войти с помощью: 

Ваш e-mail не будет опубликован. Обязательные поля помечены *

 

Этот сайт использует Akismet для борьбы со спамом. Узнайте как обрабатываются ваши данные комментариев.