-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Corrects item types and patron_types of circulation policy with pid = 10 and 11. * Adds test to check data consistency when ci-po are created. * Adds new patron type. * Closes #626. * Closes #213. Co-Authored-by: Alicia Zangger <[email protected]>
- Loading branch information
Alicia Zangger
committed
Nov 20, 2019
1 parent
f9a2c1f
commit 797ee0c
Showing
6 changed files
with
109 additions
and
32 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 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 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 |
---|---|---|
|
@@ -25,6 +25,8 @@ DATA_PATH=$(pipenv --where)/data | |
# used for create only the items and holdings files for the 'big' documents file | ||
# --deployment: | ||
# used for deploy the 'big' files | ||
# --extra_param: | ||
# used for continue script on error | ||
|
||
RED='\033[0;31m' | ||
GREEN='\033[0;0;32m' | ||
|
@@ -42,9 +44,10 @@ DEPLOYMENT=false | |
CREATE_ITEMS_HOLDINGS_SMALL=false | ||
CREATE_ITEMS_HOLDINGS_BIG=false | ||
STOP_EXECUTION=true | ||
EXTRA_PARAMETER="" | ||
|
||
# options may be followed by one colon to indicate they have a required argument | ||
if ! options=$(getopt -o dsb -l deployment,create_items_holdings_small,create_items_holdings_big,data_path: -- "$@") | ||
if ! options=$(getopt -o dsb -l deployment,create_items_holdings_small,create_items_holdings_big,extra_param,data_path: -- "$@") | ||
then | ||
# something went wrong, getopt will put out an error message for us | ||
exit 1 | ||
|
@@ -57,6 +60,7 @@ do | |
-s|--create_items_holdings_small) CREATE_ITEMS_HOLDINGS_SMALL=true ;; | ||
-b|--create_items_holdings_big) CREATE_ITEMS_HOLDINGS_BIG=true ;; | ||
-c|--continue) STOP_EXECUTION=false ;; | ||
-p|--pursue) EXTRA_PARAMETER="--dont-stop" ;; | ||
-D|--data_path) DATA_PATH=$2 ;; | ||
(--) shift; break;; | ||
(-*) display_error_message "$0: error - unrecognized option $1"; exit 1;; | ||
|
@@ -140,22 +144,22 @@ pipenv run invenio roles add [email protected] admins | |
pipenv run invenio roles add [email protected] superusers | ||
|
||
display_success_message "Organisations:" | ||
pipenv run invenio fixtures create --pid_type org ${DATA_PATH}/organisations.json --append | ||
pipenv run invenio fixtures create --pid_type org ${DATA_PATH}/organisations.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t org --yes-i-know | ||
display_success_message "Libraries:" | ||
pipenv run invenio fixtures create --pid_type lib ${DATA_PATH}/libraries.json --append | ||
pipenv run invenio fixtures create --pid_type lib ${DATA_PATH}/libraries.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t lib --yes-i-know | ||
display_success_message "Locations:" | ||
pipenv run invenio fixtures create --pid_type loc ${DATA_PATH}/locations.json --append | ||
pipenv run invenio fixtures create --pid_type loc ${DATA_PATH}/locations.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t loc --yes-i-know | ||
display_success_message "Item types:" | ||
pipenv run invenio fixtures create --pid_type itty ${DATA_PATH}/item_types.json --append | ||
pipenv run invenio fixtures create --pid_type itty ${DATA_PATH}/item_types.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t itty --yes-i-know | ||
display_success_message "Patron types:" | ||
pipenv run invenio fixtures create --pid_type ptty ${DATA_PATH}/patron_types.json --append | ||
pipenv run invenio fixtures create --pid_type ptty ${DATA_PATH}/patron_types.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t ptty --yes-i-know | ||
display_success_message "Circulation policies:" | ||
pipenv run invenio fixtures create --pid_type cipo ${DATA_PATH}/circulation_policies.json --append | ||
display_success_message "Circulation policies: ${EXTRA_PARAMETER}" | ||
pipenv run invenio fixtures create --pid_type cipo ${DATA_PATH}/circulation_policies.json --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t cipo --yes-i-know | ||
pipenv run invenio index run --raise-on-error | ||
|
||
|
@@ -183,9 +187,9 @@ else | |
HOLDINGS=${DATA_PATH}/holdings_small.json | ||
fi | ||
|
||
display_success_message "Documents:" | ||
display_success_message "Documents: ${EXTRA_PARAMETER}" | ||
echo -e ${DOCUMENTS} | ||
pipenv run invenio fixtures create --pid_type doc --schema "http://ils.rero.ch/schema/documents/document-v0.0.1.json" ${DOCUMENTS} --append | ||
pipenv run invenio fixtures create --pid_type doc --schema "http://ils.rero.ch/schema/documents/document-v0.0.1.json" ${DOCUMENTS} --append ${EXTRA_PARAMETER} | ||
|
||
if $CREATE_ITEMS_HOLDINGS_SMALL | ||
then | ||
|
@@ -209,23 +213,22 @@ then | |
fi | ||
fi | ||
|
||
display_success_message "Holdings:" | ||
display_success_message "Holdings: ${EXTRA_PARAMETER}" | ||
echo -e ${HOLDINGS} | ||
pipenv run invenio fixtures create --pid_type hold --schema "http://ils.rero.ch/schema/holdings/holding-v0.0.1.json" ${HOLDINGS} --append | ||
pipenv run invenio fixtures create --pid_type hold --schema "http://ils.rero.ch/schema/holdings/holding-v0.0.1.json" ${HOLDINGS} --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t hold --yes-i-know | ||
pipenv run invenio index run -c 4 --raise-on-error | ||
|
||
display_success_message "Items:" | ||
display_success_message "Items: ${EXTRA_PARAMETER}" | ||
echo -e ${ITEMS} | ||
pipenv run invenio fixtures create --pid_type item --schema "http://ils.rero.ch/schema/items/item-v0.0.1.json" ${ITEMS} --append | ||
pipenv run invenio fixtures create --pid_type item --schema "http://ils.rero.ch/schema/items/item-v0.0.1.json" ${ITEMS} --append ${EXTRA_PARAMETER} | ||
pipenv run invenio index reindex -t item --yes-i-know | ||
pipenv run invenio index run -c 4 --raise-on-error | ||
|
||
display_success_message "Index Documents:" | ||
pipenv run invenio index reindex -t doc --yes-i-know | ||
pipenv run invenio index run -c 4 --raise-on-error | ||
|
||
set +e | ||
display_success_message "Circulation transactions:" | ||
pipenv run invenio fixtures create_loans --fee ${DATA_PATH}/loans.json | ||
|
||
|
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