Skip to content

daaru00/gitlab-runners-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup local runners for Gitlab

Requirement

Retrieve runner registration docker

Go to your repository configuration under "Settings" -> "CI/CD", scroll down until "Set up a specific Runner manually" and you'll see the registration token to provide during setup.

gitlab-runner-token

Configure local environment

Clone this repository and copy docker-compose.example.yml to docker-compose.yml

git clone git@github.com:daaru00/gitlab-runners-local.git
cd gitlab-runners-local
cp docker-compose.example.yml docker-compose.yml

Edit docker-compose.yml file adding runner for each your repository changing only, service name, container name and REGISTRATION_TOKEN environment variable

version: '3'
services:
  project1:
    build: .
    container_name: "gitlab-runner-project1" #change this with your repository name
    environment: 
      REGISTRATION_TOKEN: "<registration token here>" #add repository-specific registration token
    volumes:
     - /var/run/docker.sock:/var/run/docker.sock

  project2:
    build: .
    container_name: "gitlab-runner-project2" #change this with your repository name
    environment: 
      REGISTRATION_TOKEN: "<registration token here>" #add repository-specific registration token
    volumes:
     - /var/run/docker.sock:/var/run/docker.sock

Run

Inside the project root directory run

docker-compose up -d

Check if runner works

Go to your repository "CI/CD Settings" (same configuration page described above), you should see you runner connected

gitlab-runner-connected

Show runner logs

Inside the project root directory run

docker-compose logs project1

About

Run Gitlab runners locally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published