Skip to content

Commit 20c557f

Browse files
authored
Merge pull request #154 from ubccr/isc-hpc-updates
Refactor initializing coldfront database
2 parents fa35052 + c15e0ee commit 20c557f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ HPCTS_VERSION="2023.05"
22
SLURM_VERSION="21.08.8-2"
33
MARIADB_VERSION=10.3
44
MONGODB_VERSION=5.0
5-
COLDFRONT_RESTORE="true"

coldfront/entrypoint.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@ then
2626
echo "-- Initializing coldfront database..."
2727
coldfront initial_setup -f
2828

29-
echo "-- Generating static css files..."
30-
coldfront collectstatic
31-
3229
echo "-- Creating superuser..."
3330
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@localhost', 'admin')" | \
3431
coldfront shell
3532
fi
3633

37-
if [ "$2" = "true" ]; then
38-
echo "---> Restoring coldfront database..."
39-
mysql --host mysql --user coldfrontapp --password=9obCuAphabeg coldfront < /usr/share/coldfront/coldfront.dump
40-
fi
34+
echo "-- Generating static css files..."
35+
coldfront collectstatic
4136

4237
echo "---> Starting nginx on coldfront..."
4338
/sbin/nginx

database/create-coldfront-db.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ EOF
1616
echo "Granting coldfront user access to coldfront database.."
1717
echo "grant all on coldfront.* to 'coldfrontapp'@'%';" | mysql -uroot
1818
echo "flush privileges;" | mysql -uroot
19+
20+
21+
if [ -f "/docker-entrypoint-initdb.d/coldfront.dump" ]; then
22+
echo "Restoring coldfront database..."
23+
mysql -uroot coldfront < /docker-entrypoint-initdb.d/coldfront.dump
24+
fi

0 commit comments

Comments
 (0)