2023-07-04 15:15:04 +00:00
|
|
|
# Gitea
|
|
|
|
|
|
|
|
Front end for Git, with integrated Container Registry and CI/CD capabilities.
|
|
|
|
This repository only contains configuration used for Kubernetes.
|
2023-07-06 11:49:33 +00:00
|
|
|
|
2024-11-11 12:45:31 +00:00
|
|
|
## From Docker to Gitea
|
|
|
|
|
|
|
|
Get a dump of your current Docker instance:
|
|
|
|
```bash
|
|
|
|
gitea dump -c /data/gitea/conf/app.ini
|
|
|
|
```
|
|
|
|
In this context, my `/data` path is mounted to the host.
|
|
|
|
|
|
|
|
Then modify the `deployment.yaml` file to only start a "sleeping" container:
|
|
|
|
```yaml
|
|
|
|
[...]
|
|
|
|
image: gitea/gitea:1.22.3
|
|
|
|
ports:
|
|
|
|
- containerPort: 3000
|
|
|
|
command: ["/bin/sh", "-c", "sleep 1000000000"] # Add this line
|
|
|
|
env:
|
|
|
|
- name: GITEA__database__DB_TYPE
|
|
|
|
value: "postgres"
|
|
|
|
[...]
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, copy the dump to the container:
|
|
|
|
```bash
|
|
|
|
kubectl cp <dump file> <namespace>/<pod name>:/data/dump
|
|
|
|
```
|
|
|
|
|
|
|
|
Get into the pod and go as follows.
|
|
|
|
|
|
|
|
Unzip the dump
|
|
|
|
```bash
|
|
|
|
unzip <dump file>
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, restore the dump
|
|
|
|
```bash
|
|
|
|
mv repo/* /data/git/repositories
|
|
|
|
mv lfs/* /data/git/lfs
|
|
|
|
mv data/* /data/gitea
|
|
|
|
```
|
|
|
|
|
|
|
|
And finally, restore the database
|
|
|
|
```bash
|
2024-11-27 12:43:28 +00:00
|
|
|
PGPASSWORD=$GITEA__database__PASSWD psql -h gitea-db-rw.gitea.svc.cluster.local -U $GITEA__database__USER < halis_gitea.sql
|
2024-11-11 12:45:31 +00:00
|
|
|
```
|