-
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} | ||
|
||
|
|
||
| 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 | ||
|
||
| cd universal | ||
| rm -f package-lock.json | ||
|
||
| 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" | ||
|
||
| 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.