Gitlab where is config.toml
Asked Answered
R

3

23

Im working on adding code quality to gitlab. one of the step requires making changes to config.toml.

I have .gitlab-ci.yml at root level of project repository.and pipeline picks up this file.

where do i define config.toml ? at root level or i need to create a new folder like /etc/gitlab-runner/config.toml

Ronen answered 18/8, 2021 at 10:31 Comment(0)
L
23

The config.toml file is what configures a runner. You wouldn't have one unless you're running your own gitlab-runners, in which case it would be in /etc/gitlab-runner/config.toml on the host running the runner. More information on Gitlab Runner and running it yourself is available here.

Lick answered 18/8, 2021 at 14:43 Comment(2)
In my case the config file was in /etc/gitlab-runner/config.tomlSubtract
Thanks @sneaky, I was remembering it wrong at the time I wrote this. I've updated my answer with the correct location.Lick
E
4

The locations where it could be is documented here.

You can find the config.toml file in:

  • /etc/gitlab-runner/ on *nix systems when GitLab Runner is executed as root (this is also the path for service configuration)
  • ~/.gitlab-runner/ on *nix systems when GitLab Runner is executed as non-root
  • ./ on other systems

But if your Run GitLab Runner in a Docker container, your config is located at

  • /etc/gitlab-runner

inside the GitLab Runner Docker container filesystem. This will correspond to the location

  • /srv/gitlab-runner/config

of your host file system if the container was started as described in the docs

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
Earnest answered 10/5, 2023 at 12:55 Comment(0)
L
2

If you are using shared runners (the default), then you need not worry about any settings in that file.

config.toml comes into the picture only if you are setting up your own runner. You should not need to create config.toml - it gets created for you when you install your own runner.

Lawannalawbreaker answered 16/4, 2023 at 14:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.