Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2712 dev scripts #2728

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Give your user all the permissions to access the portal and make CRUD updates.
./dev/make_superuser.sh $YOUR_GOOGLE_EMAIL
```

Note that **the user must be logged-in into the portal before you can issue this command**.
Note that **the user must be logged-in into the portal before you can issue this command**. To run it against a different instance/database, set `$GDH_DATABASE` to the appropriate connection string.

**Windows users**

Expand Down
5 changes: 4 additions & 1 deletion dev/make_superuser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set -e
pushd `pwd`
# We have to run docker-compose from this directory for it to pick up the .env file.
cd `dirname "$0"`
docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec mongo mongo covid19 --eval "var email='$1'; var roles=['admin', 'curator'];" /verification/scripts/roles.js

# Tell us what database to use — default is covid19 but you can override it for other instances
DB="${GDH_DATABASE:-covid19}"
docker-compose -f docker-compose.yml -f docker-compose.dev.yml exec mongo mongo "${DB}" --eval "var email='$1'; var roles=['admin', 'curator'];" /verification/scripts/roles.js
# Restore directory.
popd
3 changes: 1 addition & 2 deletions dev/setup_db.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

export CONN="mongodb://localhost/covid19"
export DB="covid19"
export DB="${DB:-covid19}"

npm --prefix=`dirname "$0"`/../data-serving/scripts/setup-db/ run-script migrate
npm --prefix=`dirname "$0"`/../data-serving/scripts/setup-db/ run-script delete-all-cases
Expand Down