Skip to content

Commit 3dfdd1f

Browse files
committed
Add documentation on how to register the runner
Additionally fix a small typo. Signed-off-by: Ryan Gonzalez <[email protected]>
1 parent 9f7f89e commit 3dfdd1f

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,57 @@ branched project/package if e.g. the upload failed.
257257

258258
## Deployment
259259

260+
### Registering the Runner
261+
262+
In order to use the runner, you must first register it with your GitLab
263+
instance. This requires the use of a registration token, which can be obtained
264+
via the following steps:
265+
266+
- Enter the GitLab admin area.
267+
- Navigate to Overview -> Runners.
268+
- Click "Register an instance runner".
269+
- Copy the registration token within.
270+
271+
(Per-group/-project registration tokens can also be retrieved from the CI/CD
272+
settings of the group or project.)
273+
274+
With this token, you can now register the runner via the [GitLab
275+
API](https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner).
276+
277+
Example using curl:
278+
279+
```bash
280+
curl --request POST "https://$GITLAB_SERVER_URL/api/v4/runners" \
281+
--form description='OBS runner' \
282+
--form run_untagged=false \
283+
--form tag_list=obs-runner \
284+
--form token="$REGISTRATION_TOKEN"
285+
```
286+
287+
httpie:
288+
289+
```bash
290+
http --form POST "https://$GITLAB_SERVER_URL/api/v4/runners" \
291+
description='OBS runner' \
292+
run_untagged=false \
293+
tag_list=obs-runner \
294+
token="$REGISTRATION_TOKEN"
295+
```
296+
297+
**It is critical that you set `run_untagged=false`,** otherwise this runner
298+
will be used for *all* jobs that don't explicitly set a tag, rather than just
299+
the jobs explicitly targeting the runner.
300+
301+
This API call will return a JSON object containing a `token` key, whose value
302+
is a _runner token_ that is used by the runner to connect to GitLab.
303+
260304
### Docker
261305
262306
Docker images are built on every commit, available at
263307
`ghcr.io/collabora/obs-gitlab-runner:main`. The entry point takes two arguments:
264308
265309
- The GitLab server URL.
266-
- A [runner token](https://docs.gitlab.com/runner/register/#requirements).
310+
- The runner token acquired previously.
267311
268312
Simple example usage via the Docker CLI:
269313
@@ -279,7 +323,7 @@ environment variables:
279323
$ docker run --rm -it \
280324
-e GITLAB_URL="$GITLAB_SERVER_URL" \
281325
-e GITLAB_TOKEN="$GITLAB_RUNNER_TOKEN" \
282-
ghcr.io/collabora/obs-gitlab-runner:mian
326+
ghcr.io/collabora/obs-gitlab-runner:main
283327
```
284328
285329
### Kubernetes

0 commit comments

Comments
 (0)