Skip to content

Commit 2d36906

Browse files
authored
Merge pull request #8101 from xdg-forks/fix-docker-initdb
2 parents 4f10f24 + 9533c4a commit 2d36906

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docker/init-db.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ if [ -d "mongotools" ]; then
2424
export PATH="$(pwd)/mongotools/bin:$PATH"
2525
fi
2626

27-
# Update the configuration file with the MongoDB connection URI
28-
mongorestore --uri="${MONGO_RESTORE_URI}" --archive="$MONGO_ARCHIVE" --nsFrom='jnet-tmpl.*' --nsTo="${MONGO_RESTORE_DB}.*"
27+
# Update the database from the mongodump archive embedded in the docker image.
28+
# The MONGO_ARCHIVE variable is the path the the archive file. Only certain collections
29+
# will be replaced, representing cards, formats, etc. User data, decks, game logs, etc.
30+
# will not be replaced. This needs to be run when https://github.com/NoahTheDuke/netrunner-data
31+
# has changed card definitions, etc.
32+
mongorestore --uri="${MONGO_RESTORE_URI}" --archive="$MONGO_ARCHIVE" --nsFrom='jnet-tmpl.*' --nsTo="${MONGO_RESTORE_DB}.*" \
33+
--nsInclude='jnet-tmpl.altarts' --nsInclude='jnet-tmpl.cards*' --nsInclude='jnet-tmpl.config' \
34+
--nsInclude='jnet-tmpl.cycles' --nsInclude='jnet-tmpl.formats' \
35+
--nsInclude='jnet-tmpl.mwls' --nsInclude='jnet-tmpl.sets' \
36+
--drop
2937

3038
echo "Database initialization completed successfully."

0 commit comments

Comments
 (0)