summaryrefslogtreecommitdiff
path: root/doc/setup-guide.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/setup-guide.md')
-rw-r--r--doc/setup-guide.md51
1 files changed, 41 insertions, 10 deletions
diff --git a/doc/setup-guide.md b/doc/setup-guide.md
index 40cff8d..3b1b5f4 100644
--- a/doc/setup-guide.md
+++ b/doc/setup-guide.md
@@ -11,6 +11,7 @@ Full instruction to build the server from a fresh Debian installation.
- `blog.swave.lol`
- `jenkins.swave.lol`
- `cgit.swave.lol`
+ - `gerrit.swave.lol`
## 1. Install Docker
@@ -199,12 +200,34 @@ pipeline {
See `doc/Jenkinsfile.example` for a full multi-stage example.
-## 7. Nginx (Reverse Proxy + SSL)
+## 7. Gerrit (Code Review)
-Nginx must be started AFTER Git Server, Ghost, and Jenkins, because it joins
+### 7.1 Create host directories
+
+```bash
+mkdir -p /var/gerrit/{etc,git,db,index,cache}
+chown -R 1000:1000 /var/gerrit # gerrit user inside container runs as UID 1000
+```
+
+### 7.2 Start Gerrit
+
+Gerrit is part of the git-server stack. It requires `jenkins_network` to exist,
+so Jenkins must be started first.
+
+```bash
+cd /root/Projects/bastion/git-server
+docker compose -f server.yaml up -d gerrit
+```
+
+Gerrit shares `/var/git/repos` with git-server for repository access.
+
+
+## 8. Nginx (Reverse Proxy + SSL)
+
+Nginx must be started AFTER Git Server, Ghost, Jenkins, and Gerrit, because it joins
their networks as external.
-### 7.1 Create host directories
+### 8.1 Create host directories
```bash
# Nginx config directory
@@ -225,7 +248,7 @@ mkdir -p /var/letsencrypt/lts_site
cp /root/Projects/bastion/nginx/letsencrypt/index.html /var/letsencrypt/lts_site/
```
-### 7.2 First run — HTTP only (no SSL yet)
+### 8.2 First run — HTTP only (no SSL yet)
Before we have SSL certificates, we need to temporarily disable the SSL server
blocks so Nginx can start and serve the ACME challenge for certbot.
@@ -244,7 +267,7 @@ cd /root/Projects/bastion/nginx
docker compose up -d
```
-### 7.3 Obtain SSL certificates
+### 8.3 Obtain SSL certificates
```bash
cd /root/Projects/bastion/nginx
@@ -256,10 +279,11 @@ This requests certificates for:
- `blog.swave.lol`
- `jenkins.swave.lol`
- `cgit.swave.lol`
+- `gerrit.swave.lol`
IMPORTANT: All DNS records must be pointing to the server before running certbot.
-### 7.4 Enable SSL
+### 8.4 Enable SSL
```bash
# Restore full nginx.conf with SSL blocks
@@ -270,7 +294,7 @@ cd /root/Projects/bastion/nginx
docker compose restart
```
-### 7.5 Verify
+### 8.5 Verify
All services should now be accessible:
@@ -282,6 +306,8 @@ All services should now be accessible:
| `https://jenkins.swave.lol` | Jenkins (subdomain) |
| `https://swave.lol/cgit` | Cgit (path-based) |
| `https://cgit.swave.lol` | Cgit (subdomain) |
+| `https://swave.lol/gerrit` | Gerrit (path-based) |
+| `https://gerrit.swave.lol` | Gerrit (subdomain) |
| `http://<server-ip>:9000` | Portainer |
| `ssh://git@<server-ip>/repos/<repo>.git` | Git (SSH) |
| `git://<server-ip>/<repo>.git` | Git (daemon, read-only) |
@@ -292,8 +318,9 @@ All services should now be accessible:
```
git-network (172.22.0.0/16)
├── git-server (172.22.0.2)
-├── cgit
-└── nginx (172.22.0.254)
+├── cgit (172.22.0.3)
+├── gerrit (172.22.0.4)
+└── nginx (172.22.0.254)
ghost_network
├── ghost
@@ -303,6 +330,7 @@ ghost_network
jenkins_network
├── jenkins
+├── gerrit
└── nginx
```
@@ -329,7 +357,10 @@ docker compose -f /root/Projects/bastion/ghost/compose.yml up -d
# 4. Jenkins (creates jenkins_network)
docker compose -f /root/Projects/bastion/jenkins/docker-compose.yaml up -d
-# 5. Nginx (joins all networks — must be last)
+# 5. Gerrit (joins git-network + jenkins_network, both must exist)
+docker compose -f /root/Projects/bastion/git-server/server.yaml up -d gerrit
+
+# 6. Nginx (joins all networks — must be last)
docker compose -f /root/Projects/bastion/nginx/docker-compose.yaml up -d
```