taiko-web-db-sync/taiko-web-db-cron.sh

18 lines
682 B
Bash
Raw Permalink Normal View History

2024-09-11 11:43:10 +00:00
#!/bin/bash
set -eu
docker exec -i taiko-mongo mongod --version
2024-09-11 11:43:10 +00:00
rm -rf ~/taiko-web-db
2024-11-30 01:41:35 +00:00
git clone --depth 1 https://github.com/yuukiwww/taiko-web-db.git ~/taiko-web-db
2024-09-11 11:43:10 +00:00
cd ~/taiko-web-db
docker exec -i taiko-mongo mongoexport --db taiko --collection users --out /dev/stdout | sort -n > users.json
docker exec -i taiko-mongo mongoexport --db taiko --collection songs --out /dev/stdout | sort -n > songs.json
docker exec -i taiko-mongo mongoexport --db taiko --collection scores --out /dev/stdout | sort -n > scores.json
git add *.json
git commit --author="BOT <bot@example.com>" -m "$(git diff --name-only --cached | paste -s -d ' ') が更新されました"
git push origin main