Skip to content

Instantly share code, notes, and snippets.

@elrayle
Created October 21, 2019 15:42
Show Gist options
  • Save elrayle/627d22518f433c637196a4a91426968d to your computer and use it in GitHub Desktop.
Save elrayle/627d22518f433c637196a4a91426968d to your computer and use it in GitHub Desktop.
#! /bin/bash
ACTION="install"
case $1 in
-h )
echo '---------------------------'
echo 'solr_wrapper startup script'
echo '---------------------------'
echo 'This script starts solr_wrapper for either ad hoc development through .internal_test app generated by `rake engine_cart:generate`'
echo 'or for testing through rspec tests.'
echo ''
echo '-d start solr for ad hoc development testing through .internal_test app generated by `rake engine_cart:generate`'
echo '-t start solr for testing through rspec tests'
echo '-v start solr for valkyrie testing through rspec tests'
echo '-h show these help instructions'
exit
;;
-v )
echo '*** Starting SOLR in VALKYRIE TEST mode ***'
COL_NAME="hydra-valkyrie-test"
PORT="-p 8987"
RUNPATH="$HOME/Services/solrvalkryietest"
;;
-t )
echo '*** Starting SOLR in TEST mode ***'
COL_NAME="hydra-test"
PORT="-p 8985"
RUNPATH="$HOME/Services/solrtest"
;;
-d | * )
echo '*** Starting SOLR in DEVELOPMENT mode ***'
COL_NAME="hydra-development"
PORT=""
RUNPATH="$HOME/Services/solrdev"
;;
esac
COL="--collection_name $COL_NAME"
echo "COL = $COL"
RUNFILE="$RUNPATH/bin/solr"
if [ -d "$RUNPATH" ] && [ -f "$RUNFILE" ]; then
ACTION="run"
fi
CMD="solr_wrapper -d solr/config/ $COL -i $RUNPATH $PORT"
echo "Will run command: $CMD"
eval $CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment