File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,13 +18,6 @@ upsert_doc() {
1818 fi
1919}
2020
21- # Function for insert mock data docs
22- insert_docs () {
23- DB=$1
24- DOC_LOC=$2
25- curl -H ' Content-Type: application/json' -X POST $COUCHURL /$DB /_bulk_docs -d @$DOC_LOC $PROXYHEADER
26- }
27-
2821# Function to add databases
2922insert_dbs () {
3023 DBS=$1
6861 COUCHURL=http://$COUCHUSER :$COUCHPASSWORD @$HOST :$PORT
6962fi
7063
71- # Adding attachments to database documents
72- # To add attachment added two file (resources-mock.json and resources-attachment-mockup.json)
73- # Ids must match between two files
74- insert_attachments () {
75- DB=$1
76- DOC_LOC=$2
77- # Use echo $(<$DOC_LOC) to be able to run in Windows
78- INPUTS=$( echo $( < $DOC_LOC ) | jq -c ' .[]' )
79- for i in $INPUTS
80- do
81- ID=$( echo $i | jq -r ' .doc_id' )
82- FILE_NAME=$( echo $i | jq -r ' .file_name' )
83- FILE_LOCATION=$( echo $i | jq -r ' .file_location' )
84- FILE_TYPE=$( echo $i | jq -r ' .file_type' )
85- REV=$( curl $COUCHURL /$DB /$ID | jq -r ' ._rev' $PROXYHEADER )
86- curl -X PUT $COUCHURL /$DB /$ID /$FILE_NAME ? rev=$REV --data-binary @$FILE_LOCATION -H Content-Type:$FILE_TYPE $PROXYHEADER
87- done
88- }
89-
9064# Reads one JSON file to update multiple databases
9165# JSON file needs a 'dbName' field with a string and
9266# a 'json' field with the JSON to be updated
Original file line number Diff line number Diff line change 11{
22 "name" : " planet" ,
33 "license" : " AGPL-3.0" ,
4- "version" : " 0.22.65 " ,
4+ "version" : " 0.22.66 " ,
55 "myplanet" : {
66 "latest" : " v0.54.54" ,
77 "min" : " v0.52.45"
You can’t perform that action at this time.
0 commit comments