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
|
|
|
|
PGPASSWORD=$GITEA__database_PASSWD psql -h $GITEA__database_HOST -U $GITEA__database_USER < gitea-db.sql
|
|
|
|
```
|