Add the GitLab Runner
Create GitLab Runner node
pxd-gitlab-runner and make it available to GitLab CE running on pxd-gitlab.Categories:
This how-to describes how to create local GitLab instance pxd-gitlab-runner. The play plays/dev/gitlab_runner.yml uses the Ansible role robertdebock.gitlab_runner
to create it. The configuration for this node is in group_vars/gitlab_runner/main.yml
Registration token
Navigate to GitLab project
c2platform/examples/kubernetes/gitlab-robot
and then Settings → CI/CD → Runners and copy the “registration
token”. Create or edit file group_vars/all/local_stuff.yml and configure the
token for example:
c2_gitlab_runner_registration_token: GR13****** # https://gitlab.com/c2projects/cgi/azure/-/settings/ci_cd
See
Local Stuff
for more information about local_stuff.yml.
Provision
vagrant up pxd-gitlab-runner
Verify
root@pxd-gitlab-runner:~# gitlab-runner list
Runtime platform arch=amd64 os=linux pid=4060 revision=dcfb4b66 version=15.10.1
Listing configured runners ConfigFile=/etc/gitlab-runner/config.toml
pxd-gitlab-runner Executor=shell Token=btPy-VV2HF2DxVxh1xzM URL=https://gitlab.com/
root@pxd-gitlab-runner:~#
Unregister
gitlab-runner list
gitlab-runner unregister -c /etc/gitlab-runner/config.toml --url https://gitlab.com/ --token <token>
Links
- Install GitLab Runner using the official GitLab repositories | GitLab
- robertdebock/ansible-role-gitlab_runner
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.