Skip to content

Commit e83f348

Browse files
author
DOMjudge
committed
Add demoweb dump script and readme how to update demoweb DB.
1 parent 02d896e commit e83f348

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

dump_demoweb_db.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
# Script to dump the DOMjudge demo web DB to ~/demoweb/domjudge_
3+
# at: https://www.domjudge.org/demoweb/
4+
5+
set -e
6+
7+
DBNAME='domjudge_demo'
8+
DUMPFILE=~/demoweb/${DBNAME}-$(date +%F).sql
9+
10+
mysqldump $DBNAME | process-mysqldump > $DUMPFILE
11+
12+
cat <<EOF
13+
14+
Dumped demoweb DB in '$DUMPFILE'.
15+
16+
Don't forget to diff the contents and update
17+
the ~/demoweb/domjudge_demo.sql symlink.
18+
EOF

update_demoweb_howto.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
To make updates to the demoweb DB (for example if the SQL structure changed):
2+
3+
- run update_demoweb.sh to ensure the DB state is fresh
4+
- make the necessary changes
5+
- run dump_demoweb_db.sh to create a new file ~/demoweb/domjudge_demo-YYYY-MM-DD.sql
6+
- check that the new file differs from the previous dump in the expected way
7+
- update the symlink ~/demoweb/domjudge_demo.sql to point to the new dump
8+
- run update_demoweb.sh to test that the new file is loaded correctly

0 commit comments

Comments
 (0)