initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
|
||||
db_redmine:
|
||||
echo "==> Dump Redmine database"
|
||||
cd /srv/stacks/redmine && docker compose exec database sh /db_backup/mariadb_backup.sh
|
||||
|
||||
db_wiki:
|
||||
echo "==> Dump Wiki database"
|
||||
cd /srv/stacks/wiki && docker compose exec wiki_db sh /db_backup/pg_backup.sh
|
||||
|
||||
db_catalog:
|
||||
echo "==> Dump Catalog database"
|
||||
cd /srv/stacks/teletype-games && docker compose exec mysql sh /db_backup/mysql_backup.sh
|
||||
|
||||
repos:
|
||||
echo "==> Get GIT repositories"
|
||||
@BASE="/srv/backup/repositories/"; \
|
||||
SRC="https://git.teletype.hu"; \
|
||||
@TOKEN=$$GITEA_TOKEN; \
|
||||
mkdir -p $$BASE; \
|
||||
curl -s -H "Authorization: token $$TOKEN" "$$SRC/api/v1/repos/search?limit=10000&private=true" \
|
||||
| jq -r '.data[] | "\(.clone_url) \(.full_name)"' \
|
||||
| while read repo fullname; do \
|
||||
repo=$$(echo $$repo | sed 's|^http://|https://|'); \
|
||||
name=$$(basename $$fullname); \
|
||||
dir="$$BASE/$$name"; \
|
||||
echo "===> Get $$repo name=$$name"; \
|
||||
if [ -d "$$dir/.git" ]; then \
|
||||
git -C "$$dir" fetch --all --prune; \
|
||||
git -C "$$dir" pull; \
|
||||
else \
|
||||
git clone "$$repo" "$$dir"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
backup: db_redmine db_wiki db_catalog repos
|
||||
Reference in New Issue
Block a user