You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 05_testing_and_ci/gitlab_ci_demo.md
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
14
14
- Edit in pipeline editor -> Visualize
15
15
- Settings -> CI/CD -> Runners -> Specific runners
16
16
- URL and Token; we will need this in a minute
17
+
- Select `Run untagged jobs` (optional, but can make things simpler for now)
17
18
18
19
## Inspect bwCloud
19
20
@@ -22,24 +23,28 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
22
23
- I have already set up a VM. What I did:
23
24
- Add public SSH key
24
25
- Instances -> Launch instance
25
-
- Ubuntu 22.04
26
+
- Ubuntu 24.04
26
27
- Flavor: m1.small
27
28
-`sudo apt update && sudo apt -y upgrade`
28
29
-`sudo apt install -y docker.io`
29
30
- VM is up and running, connect to it: `ssh ubuntu@<IP>`
30
31
32
+
You can get the IP from the [Instances view](https://portal.bw-cloud.org/project/instances/). Note that there are two addresses here: an IPv4 (decimal) and an IPv6 (hexadecimal) address. New VMs on bwCloud only support IPv6 networks, so you need the second address.
33
+
31
34
## Setup GitLab Runner
32
35
33
36
- Install GitLab Runner via Docker:
34
37
35
38
```bash
36
39
sudo docker run -d --name gitlab-runner --restart always \
40
+
--network host \
37
41
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
38
42
-v /var/run/docker.sock:/var/run/docker.sock \
39
43
gitlab/gitlab-runner:latest
40
44
```
41
45
42
46
-`docker run -d --name gitlab-runner --restart always` runs the container in the background (`-d` means detached) names it `gitlab-runner` and makes sure that it always runs. The container is automatically restarted once it stops/crashes. If you want to stop the container, you have to stop it manually (`docker container stop`).
47
+
-`--network host` tells Docker to use the host network stack and is needed on bwCloud VMs, which only support IPv6.
43
48
-`-v /srv/gitlab-runner/config:/etc/gitlab-runner` mounts the directory `/srv/gitlab-runner/config` into the container.
44
49
-`-v /var/run/docker.sock:/var/run/docker.sock` mounts important Docker files into the container such that the container can start other containers (for pipelines).
45
50
-`gitlab/gitlab-runner:latest` is the GitLab Runner image used from Docker Hub.
@@ -51,8 +56,18 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
51
56
52
57
## Register Runner
53
58
54
-
-`sudo docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register`
You can register a runner using the following command. Notice again the `--network host` option, which tells Docker to use the host network stack. This is an important workaround for the fact that bwCloud only supports IPv6 networks:
0 commit comments