-
Notifications
You must be signed in to change notification settings - Fork 6
GPII-3138: Update Prefs Safes and their GPII Keys in the data base #6
base: master
Are you sure you want to change the base?
Changes from 12 commits
edfc334
760b795
3583141
f2374d4
c1a494f
a8a161f
98e70d3
d042026
96bddc6
7a290b2
01908db
372e9c4
8118574
d42e2a5
a730327
0e9577b
933d03f
0ba06e4
9bb3f46
8c60cd8
ab35aa1
0034b4d
2059195
29b414e
c9cf927
82aa358
c14879c
b7bea34
9b4b3f1
0ec50b3
05e8dcc
a147932
ab4d265
2680cd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| STATIC_DATA_DIR=${STATIC_DATA_DIR:-/home/node/universal/testData/dbData} | ||
| BUILD_DATA_DIR=${BUILD_DATA_DIR:-/home/node/universal/build/dbData} | ||
| NODE_PATH=${NODE_PATH:-/home/node/universal} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am thinking if a var name like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that It's a little ambiguous because "universal" can mean so many things, but I like
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a way to eliminate the |
||
|
|
||
| log() { | ||
| echo "$(date +'%Y-%m-%d %H:%M:%S') - $1" | ||
|
|
@@ -31,7 +32,24 @@ if [ -z "$COUCHDB_URL" ]; then | |
| fi | ||
|
|
||
| log "Starting" | ||
| log "Clear index: $CLEAR_INDEX" | ||
| log "Static: $STATIC_DATA_DIR" | ||
| log "Build: $BUILD_DATA_DIR" | ||
| log "Node path: $NODE_PATH" | ||
| log "Working directory: `pwd`" | ||
|
|
||
| # Set up universal | ||
| git clone https://github.com/GPII/universal.git | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for making this change by dynamically pulling universal repo at every run.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @cindyli. You're right, the httpTests.js was just an investigative script to see how the http module worked, especially with CouchDB urls. I've removed it. I've also updated the README
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize you are just moving what was there before (and I probably should have caught it when reviewing the change when Cindy made it ;)), but please add
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. Done. |
||
| cd universal | ||
| rm -f package-lock.json | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is no longer necessary as
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right; however, the subsequent |
||
| npm install json5 | ||
| npm install fs | ||
| npm install rimraf | ||
| npm install mkdirp | ||
| node scripts/convertPrefs.js testData/preferences/ build/dbData/ | ||
| cd - | ||
|
|
||
| # Initialize (possibly clear) data base | ||
| if [ ! -z "$CLEAR_INDEX" ]; then | ||
| log "Deleting database at $COUCHDB_URL" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
| if ! curl -fsS -X DELETE "$COUCHDB_URL"; then | ||
|
|
@@ -45,5 +63,6 @@ if ! curl -fsS -X PUT "$COUCHDB_URL"; then | |
| fi | ||
|
|
||
| # Submit data | ||
| node $NODE_PATH/scripts/deleteSnapsets.js $COUCHDB_URL | ||
| loadData $STATIC_DATA_DIR | ||
| loadData $BUILD_DATA_DIR | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
[-e CLEAR_INDEX=1]is meant to indicate that this parameter is optional (hence the square brackets). Was this the intent?I think this is going to confuse users, because when I copy/paste the line I get this unhelpful error:
I suggest removing the
[-e CLEAR_INDEX=1]clause from this command and mentioning it in a bullet point afterward, or listing the complete command twice -- once with and once without the[-e CLEAR_INDEX=1].There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea @mrtyler. I've taken the second approach showing the two ways to run the image, one with
CLEAR_INDEXset, and another with it not set.