Gitea: configure backups again
This commit is contained in:
21
files/gitea/backup.sh.j2
Normal file
21
files/gitea/backup.sh.j2
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
echo "Gitea: backup data with gitea dump"
|
||||
|
||||
(cd "{{ base_dir }}" && \
|
||||
docker compose exec \
|
||||
-u "{{ user_create_result.uid }}:{{ user_create_result.group }}" \
|
||||
-w /backups gitea_app \
|
||||
gitea dump -c /data/gitea/conf/app.ini \
|
||||
)
|
||||
|
||||
|
||||
echo "Gitea: remove old backups"
|
||||
|
||||
keep-files.py "{{ backups_dir }}" --keep 3
|
||||
|
||||
|
||||
echo "Gitea: done."
|
@ -8,8 +8,8 @@ services:
|
||||
- "127.0.0.1:{{ gitea_port }}:3000"
|
||||
- "2222:22"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./backups:/backups
|
||||
- {{ data_dir }}:/data
|
||||
- {{ backups_dir }}:/backups
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
|
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
echo "Gitea: backup data with gitea dump"
|
||||
|
||||
(cd {{ base_dir }} && docker compose exec -u "{{ user_create_result.uid }}:{{ user_create_result.group }}" -w /backups gitea_app gitea dump -c /data/gitea/conf/app.ini)
|
||||
|
||||
|
||||
echo "Gitea: remove old backups"
|
||||
|
||||
keep-files.py {{ backups_dir }} --keep 2
|
Reference in New Issue
Block a user