-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update init db script and documentation (#103)
* update init db script and documentation * load env variable in initdb script * fix running scripts outside container * typo --------- Co-authored-by: Antoine Jeanneney <antoine.jeanneney@justice.fr>
- Loading branch information
1 parent
c881d7b
commit ba6a2e8
Showing
3 changed files
with
43 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
#!/bin/sh | ||
|
||
if [ -f .env ]; then | ||
export $(grep -v '^#' .env | xargs) | ||
fi | ||
|
||
cd packages/courDeCassation; | ||
|
||
echo "Reset the DB except for users and migrations" | ||
RUN_MODE=LOCAL node packages/courDeCassation/dist/scripts/clearDb.js -s packages/courDeCassation/settings/settings.json | ||
sh scripts/runLocalScript.sh ./dist/scripts/clearDb.js; | ||
|
||
echo "Import the documents from SDER database" | ||
RUN_MODE=LOCAL node packages/courDeCassation/dist/scripts/importAllDocumentsFromSderSinceOrBetween.js --fromDaysAgo 2 -s packages/courDeCassation/settings/settings.json | ||
sh scripts/runLocalScript.sh ./dist/scripts/importAllDocumentsFromSderSinceOrBetween.js --fromDaysAgo 2; | ||
|
||
echo "Annotate all the documents with the NLP engine" | ||
RUN_MODE=LOCAL node packages/courDeCassation/dist/scripts/annotateDocumentsWithoutAnnotationsWithNlp.js -s packages/courDeCassation/settings/settings.json | ||
sh scripts/runLocalScript.sh ./dist/scripts/annotateDocumentsWithoutAnnotationsWithNlp.js; | ||
|
||
echo "Insert mock values in DB" | ||
RUN_MODE=LOCAL node packages/courDeCassation/dist/scripts/initializeTestDb.js -s packages/courDeCassation/settings/settings.json | ||
sh scripts/runLocalScript.sh ./dist/scripts/initializeTestDb.js; | ||
|
||
echo "Create initial cache" | ||
RUN_MODE=LOCAL node packages/courDeCassation/dist/scripts/renewCache.js --beforeMinutes=5 -s packages/courDeCassation/settings/settings.json | ||
sh scripts/runLocalScript.sh ./dist/scripts/renewCache.js --beforeMinutes=5; | ||
|
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,12 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_NAME="$1" | ||
shift | ||
|
||
if [ -f .env ]; then | ||
export $(grep -v '^#' .env | xargs) | ||
fi | ||
|
||
cd packages/courDeCassation; | ||
|
||
sh scripts/runLocalScript.sh ./dist/scripts/$SCRIPT_NAME |