-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored how local db is started, now uses the db files on s3 so lo…
…cal DB is the same as what we're restoring to environments. Uses AWS s3 sync command to download the files so if they're there already it's quicker.
- Loading branch information
Peter Nemere
committed
Oct 28, 2024
1 parent
eb159aa
commit 41db8fd
Showing
7 changed files
with
11 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
aws s3 sync s3://pixlise-backup/DB/pixlise-prodv4/ ./db-restore/ | ||
|
||
# Start Mongo | ||
# Initiate a replica set (rs.initiate()) | ||
# Call import.sh to reload last saved mongo dump | ||
docker run --rm -d -v /$PWD/db-restore:/db-restore -p 27017:27017 -h $(hostname) --name mongo-test mongo:4.0.28 --replSet=test && sleep 4 && docker exec mongo-test mongo --eval "rs.initiate();" && sleep 2 && docker exec mongo-test mongorestore --gzip --db "pixlise-localdev" db-restore/ |