Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122661460
run-initdb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 21, 10:24
Size
1 KB
Mime Type
text/x-shellscript
Expires
Wed, Jul 23, 10:24 (2 d)
Engine
blob
Format
Raw Data
Handle
27501972
Attached To
rHBPLUCENESOLRDOCKER HBP Lucene/Solr Docker
run-initdb
View Options
#!/bin/bash
#
# Run the init-hbp-solr-home script and source any '.sh' scripts that are found
# in `/docker-entrypoint-initdb.d`. Files there will be executed in alphabetical
# order.
#
# This script (run-initdb) is sourced by some of the solr-* commands, so that
# I can run eg:
#
# mkdir initdb; echo "echo hi" > initdb/hi.sh
# docker run -v $PWD/initdb:/docker-entrypoint-initdb.d hbp-lucene-solr
#
# and have your script execute before hbp-lucene-solr instance starts.
#
# Note: scripts can modify the environment, which will affect subsequent scripts
# and ultimately Solr. That allows you to set environment variables from your
# scripts (though you usually just use "docker run -e"). If this is undesirable
# in your use-case, have your scripts execute a sub-shell.
set
-e
# init script for handling a custom SOLR_HOME
/opt/hbp-lucene-solr-docker/scripts/init-hbp-solr-home
# execute files in /docker-entrypoint-initdb.d before starting hbp-lucene-solr
SCRIPTS_TO_RUN
=
/tmp/init-scripts-to-run
find /docker-entrypoint-initdb.d/ -mindepth 1 -type f | sort -n >
"$SCRIPTS_TO_RUN"
readarray -t scripts_to_run <
"$SCRIPTS_TO_RUN"
rm
"$SCRIPTS_TO_RUN"
for
f in
"${scripts_to_run[@]}"
;
do
case
"$f"
in
*.sh
)
echo
"$0: running $f"
; .
"$f"
;;
*
)
echo
"$0: ignoring $f"
;;
esac
echo
done
Event Timeline
Log In to Comment