18 lines
641 B
Bash
18 lines
641 B
Bash
![]() |
#!/bin/bash
|
||
|
|
||
|
set -eu
|
||
|
|
||
|
test "$(docker container inspect -f '{{.State.Status}}' taiko-mongo)" = "running"
|
||
|
|
||
|
cd ~/taiko-web-db
|
||
|
|
||
|
git reset --hard HEAD
|
||
|
|
||
|
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
|