Gitea/README.md

1.0 KiB

Gitea

Front end for Git, with integrated Container Registry and CI/CD capabilities. This repository only contains configuration used for Kubernetes.

From Docker to Gitea

Get a dump of your current Docker instance:

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:

[...]
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:

kubectl cp <dump file> <namespace>/<pod name>:/data/dump

Get into the pod and go as follows.

Unzip the dump

unzip <dump file>

Then, restore the dump

mv repo/* /data/git/repositories
mv lfs/* /data/git/lfs
mv data/* /data/gitea

And finally, restore the database

PGPASSWORD=$GITEA__database_PASSWD psql -h $GITEA__database_HOST -U $GITEA__database_USER < gitea-db.sql