Skip to content

Commit

Permalink
Merge pull request #6530 from poikilotherm/6529-solr-script
Browse files Browse the repository at this point in the history
Enhancing the Solr schema update script. See #6529
  • Loading branch information
kcondon authored Jan 16, 2020
2 parents 32be08e + c29c461 commit 804eac3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions conf/solr/7.3.1/updateSchemaMDB.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -euo pipefail

# This script updates the <field> and <copyField> schema configuration necessary to properly
Expand Down Expand Up @@ -61,6 +61,12 @@ echo "Retrieve schema data from ${DATAVERSE_URL}/api/admin/index/solr/schema"
TMPFILE=`mktemp`
curl -f -sS "${DATAVERSE_URL}/api/admin/index/solr/schema${UNBLOCK_KEY}" > $TMPFILE

### Fail gracefull if Dataverse is not ready yet.
if [[ "`wc -l ${TMPFILE}`" < "3" ]]; then
echo "Dataverse responded with empty file. When running on K8s: did you bootstrap yet?"
exit 123
fi

### Processing
echo "Writing ${TARGET}/schema_dv_mdb_fields.xml"
echo "<fields>" > ${TARGET}/schema_dv_mdb_fields.xml
Expand All @@ -76,4 +82,4 @@ rm ${TMPFILE}*

### Reloading
echo "Triggering Solr RELOAD at ${SOLR_URL}/solr/admin/cores?action=RELOAD&core=collection1"
curl -f -sS "${SOLR_URL}/solr/admin/cores?action=RELOAD&core=collection1"
curl -f -sS "${SOLR_URL}/solr/admin/cores?action=RELOAD&core=collection1"

0 comments on commit 804eac3

Please sign in to comment.