beye.blog logo

Task 3: GitLab Runner

Task 3: GitLab Runner

Register the First GitLab Runner

With the base infrastructure established, the next step involves deploying a GitLab Runner to prepare for pipeline deployment.

Initial Configuration Steps

Navigate to the project settings and access the CI/CD section. Locate the "Runners" area and expand it to reveal the necessary details.

GitLab settings interface
GitLab settings interface

Disable the "Enable shared runners" option and keep this page accessible. You'll need the GitLab instance URL and registration token for the subsequent registration process.

Runners configuration panel
Runners configuration panel

Runner settings with token
Runner settings with token

Register Docker Runner

Return to your Ubuntu server SSH session and execute the registration command:

bash
sudo gitlab-runner register

When prompted, provide the following information:

  • GitLab coordinator URL: http://198.18.134.28/
  • Registration token: Use your token from the GitLab interface
  • Description: Docker (or your preferred identifier)
  • Tags: docker
  • Executor type: docker
  • Default Docker image: alpine:3.16.2

Expected output confirms successful registration with a unique runner ID.

Register Shell Runner

Execute the registration command a second time:

bash
sudo gitlab-runner register

Provide these details:

  • GitLab coordinator URL: http://198.18.134.28/
  • Registration token: Use your token from the GitLab interface
  • Description: Shell (or your preferred identifier)
  • Tags: shell
  • Executor type: shell

Verification

Refresh the GitLab CI/CD settings page and expand the "Runners" section. Both runners should now appear with their respective tags ("docker" and "shell") visible.

Registered runners display
Registered runners display

With two runners successfully registered, you're prepared to deploy your first CI/CD pipeline.