Skip to content

Commit cf42228

Browse files
committed
Allow passing the root password
(cherry picked from commit 7649689)
1 parent 7ee2748 commit cf42228

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/jobs/baseinstall.sh

+9-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ alias section_end='trace_off ; section_end_internal '
1919

2020
export version="$1"
2121

22+
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
23+
2224
set -eux
2325

2426
section_start "Update packages"
@@ -85,11 +87,11 @@ section_end
8587

8688
if [ "${db}" = "install" ]; then
8789
section_start "Install DOMjudge database"
88-
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot bare-install
90+
/opt/domjudge/domserver/bin/dj_setup_database -uroot -p${MYSQL_ROOT_PASSWORD} bare-install
8991
section_end
9092
elif [ "${db}" = "upgrade" ]; then
9193
section_start "Upgrade DOMjudge database"
92-
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot upgrade
94+
/opt/domjudge/domserver/bin/dj_setup_database -uroot -p${MYSQL_ROOT_PASSWORD} upgrade
9395
section_end
9496
fi
9597

@@ -125,9 +127,11 @@ for service in nginx php${PHPVERSION}-fpm; do
125127
done
126128
section_end
127129

128-
section_start "Install the example data"
129-
/opt/domjudge/domserver/bin/dj_setup_database -uroot -proot install-examples
130-
section_end
130+
if [ "${db}" = "install" ]; then
131+
section_start "Install the example data"
132+
/opt/domjudge/domserver/bin/dj_setup_database -uroot -p${MYSQL_ROOT_PASSWORD} install-examples | tee -a "$ARTIFACTS/mysql.txt"
133+
section_end
134+
fi
131135

132136
section_start "Setup user"
133137
# We're using the admin user in all possible roles

0 commit comments

Comments
 (0)