Skip to content

Commit

Permalink
upgrade db
Browse files Browse the repository at this point in the history
  • Loading branch information
as6325400 committed Oct 20, 2024
1 parent 22915f1 commit 6779d1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions .github/jobs/baseinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ mysql_user "SELECT CURRENT_USER();"
mysql_user "SELECT USER();"
section_end

section_start "Install DOMjudge database"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot bare-install
section_end
if [ "${db}" = "install" ]; then
section_start "Install DOMjudge database"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot bare-install
section_end
elif [ "${db}" = "upgrade" ]; then
section_start "Upgrade DOMjudge database"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot upgrade
section_end
fi

section_start "Show PHP config"
php -v | tee -a "$ARTIFACTS"/php.txt
Expand Down Expand Up @@ -94,12 +100,10 @@ for service in nginx php${PHPVERSION}-fpm; do
done
section_end

if [ "${db}" != "none" ]; then
if [ "${db}" = "install" ]; then
section_start "Install the example data"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot install-examples | tee -a "$ARTIFACTS/mysql.txt"
section_end
fi
if [ "${db}" = "install" ]; then
section_start "Install the example data"
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot install-examples | tee -a "$ARTIFACTS/mysql.txt"
section_end
fi

section_start "Setup user"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/database-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install DOMjudge
run: .github/jobs/baseinstall.sh default none
run: .github/jobs/baseinstall.sh default upgrade

- name: Check for Errors in the Upgrade
run: |
Expand Down

0 comments on commit 6779d1a

Please sign in to comment.