0

Lets say I have multiple projects located on 1 machine. Currently, the runner is configured to run as gitlab-runner user for all projects.

Is there a way to run gitlab-runner as multiple different users and registering them for each project? ie: project1 user will run the runner for project1 only, project2 runner will run the runner for project2 only and so on. The reason to do this is to limit the access usage that the gitlab-runner user has on all the projects.

Please advise or point me towards the light. Your assistance is greatly appreciated.

Thanks in advance.

most2
  • 21
  • 2

2 Answers2

0

You can tag different runners for different projects.

tags is used to select specific Runners from the list of all Runners that are allowed to run this project.

During the registration of a Runner, you can specify the Runner’s tags, for example, ruby, postgres, development

tags allow you to run jobs with Runners that have the specified tags assigned to them:

job:
  tags:
    - ruby
    - postgres

For more details, please refer to https://docs.gitlab.com/ee/ci/yaml/#tags

Maverick
  • 1,519
  • 18
  • 32
  • You can also edit the tags after the runner has been registered. – mles Feb 15 '19 at 12:19
  • is there a way to run a runner for different users in their respective home directories? eg: user 1 will have its build dir in /home/user1/build and user 2 will have also have its build dir in /home/user2/build. is this possible in gitlab? – most2 Feb 18 '19 at 10:08
  • Why do you want to assign the runners on the basis of users? – Maverick Feb 19 '19 at 04:25
  • @Maverick for security purposes i.e to secure the accessibility of each project. the current situation is that gitlab-runner user has access to all the projects. – most2 Feb 20 '19 at 07:30
0

Found below option which can help to run mutiple runner service

# gitlab-runner run - run multi runner service

# gitlab-runner run [command options] [arguments...]
HJS
  • 23
  • 6