Skip to content

Commit 3f53507

Browse files
committed
Major update of rollout for 160_gitlab_ci
1 parent 4d96c20 commit 3f53507

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+646
-465
lines changed

150_gitlab/001_quickstart/gitlab.demo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ docker run -d --name gitlab \
66
--volume gitlab_logs:/var/log/gitlab \
77
--volume gitlab_data:/var/opt/gitlab \
88
--publish 80:80 \
9-
gitlab/gitlab-ee:17.5.0-ee.0
9+
gitlab/gitlab-ee:17.5.1-ee.0
1010

1111
# Wait for container to finish starting
1212
while docker container inspect gitlab \

150_gitlab/100_reverse_proxy/compose.tls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ services:
5757

5858
# https://docs.gitlab.com/ee/install/docker.html
5959
gitlab:
60-
image: gitlab/gitlab-ee:17.5.0-ee.0
60+
image: gitlab/gitlab-ee:17.5.1-ee.0
6161
environment:
6262
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
6363
GITLAB_OMNIBUS_CONFIG: |

150_gitlab/100_reverse_proxy/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343

4444
# https://docs.gitlab.com/ee/install/docker.html
4545
gitlab:
46-
image: gitlab/gitlab-ee:17.5.0-ee.0
46+
image: gitlab/gitlab-ee:17.5.1-ee.0
4747
environment:
4848
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
4949
GITLAB_OMNIBUS_CONFIG: |

150_gitlab/180_components/compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ volumes:
1717
services:
1818

1919
gitlab:
20-
image: gitlab/gitlab-ee:17.5.0-ee.0
20+
image: gitlab/gitlab-ee:17.5.1-ee.0
2121
environment:
2222
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
2323
GITLAB_OMNIBUS_CONFIG: |
@@ -73,7 +73,7 @@ services:
7373
traefik.tcp.routers.ssh.service: ssh
7474

7575
db:
76-
image: gitlab/gitlab-ee:17.5.0-ee.0
76+
image: gitlab/gitlab-ee:17.5.1-ee.0
7777
environment:
7878
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
7979
GITLAB_OMNIBUS_CONFIG: |
@@ -110,7 +110,7 @@ services:
110110
- postgres-log:/var/log/gitlab
111111

112112
redis:
113-
image: gitlab/gitlab-ee:17.5.0-ee.0
113+
image: gitlab/gitlab-ee:17.5.1-ee.0
114114
environment:
115115
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
116116
GITLAB_OMNIBUS_CONFIG: |
@@ -137,7 +137,7 @@ services:
137137
- redis-log:/var/log/gitlab
138138

139139
gitaly:
140-
image: gitlab/gitlab-ee:17.5.0-ee.0
140+
image: gitlab/gitlab-ee:17.5.1-ee.0
141141
environment:
142142
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
143143
GITLAB_OMNIBUS_CONFIG: |

150_gitlab/180_components/docker-compose.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ services:
5555

5656
# https://docs.gitlab.com/ee/install/docker.html
5757
redis:
58-
image: gitlab/gitlab-ee:17.5.0-ee.0
58+
image: gitlab/gitlab-ee:17.5.1-ee.0
5959
environment:
6060
# https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/16.1.2+ee.0/files/gitlab-config-template/gitlab.rb.template#L1383
6161
GITLAB_OMNIBUS_CONFIG: |
@@ -80,7 +80,7 @@ services:
8080

8181
# https://docs.gitlab.com/ee/install/docker.html
8282
postgres:
83-
image: gitlab/gitlab-ee:17.5.0-ee.0
83+
image: gitlab/gitlab-ee:17.5.1-ee.0
8484
environment:
8585
# https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/16.1.2+ee.0/files/gitlab-config-template/gitlab.rb.template#L1229
8686
GITLAB_OMNIBUS_CONFIG: |
@@ -124,7 +124,7 @@ services:
124124

125125
# https://docs.gitlab.com/ee/install/docker.html
126126
gitaly:
127-
image: gitlab/gitlab-ee:17.5.0-ee.0
127+
image: gitlab/gitlab-ee:17.5.1-ee.0
128128
environment:
129129
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
130130
GITLAB_OMNIBUS_CONFIG: |
@@ -181,7 +181,7 @@ services:
181181

182182
# https://docs.gitlab.com/ee/install/docker.html
183183
application:
184-
image: gitlab/gitlab-ee:17.5.0-ee.0
184+
image: gitlab/gitlab-ee:17.5.1-ee.0
185185
environment:
186186
GITLAB_SKIP_UNMIGRATED_DATA_CHECK: true
187187
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
@@ -234,7 +234,7 @@ services:
234234

235235
# https://docs.gitlab.com/ee/install/docker.html
236236
pages:
237-
image: gitlab/gitlab-ee:17.5.0-ee.0
237+
image: gitlab/gitlab-ee:17.5.1-ee.0
238238
environment:
239239
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
240240
GITLAB_OMNIBUS_CONFIG: |
@@ -261,7 +261,7 @@ services:
261261

262262
# https://docs.gitlab.com/ee/install/docker.html
263263
monitoring:
264-
image: gitlab/gitlab-ee:17.5.0-ee.0
264+
image: gitlab/gitlab-ee:17.5.1-ee.0
265265
environment:
266266
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
267267
GITLAB_OMNIBUS_CONFIG: |

150_gitlab/bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
uniget update
44
uniget install glab
55

6-
docker pull gitlab/gitlab-ee:17.5.0-ee.0
7-
docker pull gitlab/gitlab-ee:17.5.1-ee.0
6+
docker pull gitlab/gitlab-ee:17.5.1-ee.0
7+
docker pull gitlab/gitlab-ee:17.5.2-ee.0

160_gitlab_ci/000_rollout/README.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,112 @@ make apply
2525

2626
## Bootstrap services
2727

28+
Checkout the next directories called `../00?_*` and follow the instructions
29+
30+
## Testing
31+
32+
View GitLab:
33+
34+
```shell
35+
ssh gitlab env -C /root/container-slides/160_gitlab_ci/001_server docker-compose ps -a
36+
```
37+
38+
View GitLab Runner:
39+
40+
```shell
41+
ssh gitlab env -C /root/container-slides/160_gitlab_ci/002_runner docker-compose ps -a
42+
```
43+
44+
View instances of Visual Studio Code:
45+
46+
```shell
47+
ssh vscode env -C /root/container-slides/160_gitlab_ci/003_vscode docker-compose ps -a --format "table {{.ID}}\t{{.Name}}\t{{.State}}"
48+
```
49+
50+
Test DNS resolution:
51+
52+
```shell
53+
dig +short code.inmylab.de
54+
dig +short gitlab.inmylab.de
55+
dig +short vscode.inmylab.de
56+
dig +short grafana.inmylab.de
57+
```
58+
59+
Test endpoints:
60+
61+
```shell
62+
curl -sSI https://code.inmylab.de/
63+
curl -sSI https://gitlab.inmylab.de/
64+
curl -sSI https://grafana.inmylab.de/
65+
seq 0 20 | xargs -I{} curl -sSI https://seat{}.vscode.inmylab.de
66+
seq 0 20 | xargs -I{} curl -sSI https://code.inmylab.de/seat{}/
67+
```
68+
69+
List runners:
70+
71+
```shell
72+
curl -sSLfH "Private-Token: $(jq -r '.gitlab_admin_token' seats.json)" https://gitlab.inmylab.de/api/v4/runners/all?type=instance_type | jq .
73+
```
74+
75+
Test authentication for code.inmylab.de:
76+
77+
```shell
78+
seq 0 20 \
79+
| while read -r INDEX; do
80+
CODE="$( jq -r --arg index ${INDEX} '.seats[$index | tonumber].code' seats.json )"
81+
AUTH="$( echo -n "seat${INDEX}:${CODE}" | base64 -w0 )"
82+
curl -sSIH "Authorization: Basic ${AUTH}" https://code.inmylab.de/seat${INDEX}/
83+
done
84+
```
85+
86+
Test authentication for vscode.inmylab.de:
87+
88+
```shell
89+
seq 0 20 \
90+
| while read -r INDEX; do
91+
PASS="$( jq -r --arg index ${INDEX} '.seats[$index | tonumber].password' seats.json )"
92+
AUTH="$( echo -n "seat${INDEX}:${PASS}" | base64 -w0 )"
93+
curl -sSIH "Authorization: Basic ${AUTH}" https://seat${INDEX}.vscode.inmylab.de/
94+
done
95+
```
96+
97+
Test PAT for gitlab.inmylab.de:
98+
99+
```shell
100+
seq 0 20 | while read -r INDEX; do
101+
PAT="$( jq -r --arg index ${INDEX} '.[$index | tonumber]' ../001_server/personal_access_tokens.json )"
102+
curl -sSH "Private-Token: ${PAT}" https://gitlab.inmylab.de/api/v4/user \
103+
| jq -r .username
104+
done
105+
```
106+
107+
Block all users:
108+
109+
```shell
110+
seq 0 20 | while read -r INDEX; do
111+
PAT="$( jq -r '.gitlab_admin_token' seats.json )"
112+
USER_ID="$( curl -sSH "Private-Token: ${PAT}" https://gitlab.inmylab.de/api/v4/users?username=seat${INDEX} | jq -r .[0].id )"
113+
curl -sSH "Private-Token: ${PAT}" -X POST https://gitlab.inmylab.de/api/v4/users/${USER_ID}/block
114+
done
115+
```
116+
117+
Unblock all users:
118+
119+
```shell
120+
seq 0 20 | while read -r INDEX; do
121+
PAT="$( jq -r '.gitlab_admin_token' seats.json )"
122+
USER_ID="$( curl -sSH "Private-Token: ${PAT}" https://gitlab.inmylab.de/api/v4/users?username=seat${INDEX} | jq -r .[0].id )"
123+
curl -sSH "Private-Token: ${PAT}" -X POST https://gitlab.inmylab.de/api/v4/users/${USER_ID}/unblock
124+
done
125+
```
126+
127+
Fetch last activity:
128+
28129
```shell
29-
bash bootstrap.sh
130+
seq 0 20 | while read -r INDEX; do
131+
PAT="$( jq -r '.gitlab_admin_token' seats.json )"
132+
USER_ID="$( curl -sSH "Private-Token: ${PAT}" https://gitlab.inmylab.de/api/v4/users?username=seat${INDEX} | jq -r .[0].id )"
133+
curl -sSH "Private-Token: ${PAT}" https://gitlab.inmylab.de/api/v4/users/${USER_ID} \
134+
| jq -r '"last_sign_in_at: \(.last_sign_in_at)\nlast_activity_on: \(.last_activity_on)\nsign_in_count: \(.sign_in_count)"'
135+
done
30136
```

160_gitlab_ci/000_rollout/bootstrap.sh

Lines changed: 0 additions & 85 deletions
This file was deleted.

160_gitlab_ci/000_rollout/gitlab.pkr.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ locals {
1313
traefik_version = "3.1.6"
1414
code_server_version = "4.93.1"
1515
nginx_version = "1.27.2"
16+
grafana_version = "11.3.1"
1617
}
1718

1819
source "hcloud" "gitlab" {
@@ -42,7 +43,8 @@ build {
4243
"docker pull traefik:${local.traefik_version}",
4344
"docker pull gitlab/gitlab-runner:v${local.gitlab_runner_version}",
4445
"docker pull codercom/code-server:${local.code_server_version}",
45-
"docker pull nginx:${local.nginx_version}"
46+
"docker pull nginx:${local.nginx_version}",
47+
"docker pull grafana/grafana:${local.grafana_version}"
4648
]
4749
}
4850
}

160_gitlab_ci/000_rollout/main.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ resource "acme_certificate" "gitlab" {
9595
"*.dev.webdav.${local.domain}",
9696
"*.live.webdav.${local.domain}",
9797
"gitlab.${local.domain}",
98-
"*.gitlab.${local.domain}"
98+
"*.gitlab.${local.domain}",
99+
"grafana.${local.domain}"
99100
]
100101

101102
dns_challenge {
@@ -249,6 +250,14 @@ resource "hetznerdns_record" "gitlab" {
249250
ttl= 120
250251
}
251252

253+
resource "hetznerdns_record" "grafana" {
254+
zone_id = data.hetznerdns_zone.main.id
255+
name = "grafana"
256+
value = hcloud_server.gitlab.ipv4_address
257+
type = "A"
258+
ttl= 120
259+
}
260+
252261
resource "hetznerdns_record" "gitlab_wildcard" {
253262
zone_id = data.hetznerdns_zone.main.id
254263
name = "*.gitlab"

0 commit comments

Comments
 (0)