GitLab CI - Configuring Gitlab Runners


Advertisements

Description

GitLab runner is a build instance which is used to run the jobs over multiple machines and send the results to GitLab and which can be placed on separate users, servers, and local machine. You can register the runner as shared or specific after installing it. The installation of runner is explained in the GitLab Installation chapter.

You can serve your jobs by using either specific or shared runners.

Shared Runners

These runners are useful for jobs multiple projects which have similar requirements. Instead of using multiple runners for many projects, you can use a single or a small number of Runners to handle multiple projects which will be easy to maintain and update.

Specific Runners

These runners are useful to deploy a certain project, if jobs have certain requirements or specific demand for the projects. Specific runners use FIFO (First In First Out) process for organizing the data with first-come first-served basis.

You can register a specific runner by using project registration token. The registering a specific runner is explained in the GitLab Installation chapter from step 1 to 12 under the Installation of GitLab on Windows section.

Locking a specific Runner

You can lock a specific runner from being enabled for other projects. To do this, you need to register a runner which is explained in the GitLab Installation chapter from step 1 to 12 under the Installation of GitLab on Windows section.

To lock runner, execute the below steps −

Step 1 − Login to your GitLab account and go to your project −

GitLab Installation

Step 2 − Click on the CI/CD option under Settings tab and expand the Runners Settings option. −

GitLab Installation

Step 3 − Under Runners Settings section, you will see the activated Runners for the project −

GitLab Installation

Step 4 − Now click on the pencil button −

GitLab Runner

Step 5 − Next it will open the Runner screen and check the Lock to current projects option −

GitLab Runner

Click on the Save changes button to take the changes effect.

Step 6 − After saving the changes, it will update the Runner successfully.

GitLab Runner

Protected Runners

The runners can be protected to save the important information. You can protect the runner by using below steps −

Step 1 − Follow the same steps (from step 1 to 4) which are explained in the previous section (Locking a specific Runner).

Step 2 − After clicking on the pencil button, it will open the Runner screen and then check the Protected option −

GitLab Installation

Click on the Save changes button to take the changes effect.

Run untagged Jobs

You can prevent runners from picking jobs with tags when there are no tags assigned to runners. Runner can pick tagged/untagged jobs by using below steps −

Step 1 − Follow the same steps (from step 1 to 4) which are explained in the Locking a specific Runner section.

Step 2 − After clicking on the pencil button, it will open the Runner screen and then check the Run untagged jobs option −

GitLab Installation

Click on the Save changes button to take the changes effect.

Advertisements