commit
This commit is contained in:
42
solr/docker/scripts/run-initdb
Executable file
42
solr/docker/scripts/run-initdb
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Run the init-solr-home script and source any '.sh' scripts in
|
||||
# /docker-entrypoint-initdb.d.
|
||||
# This script is sourced by some of the solr-* commands, so that
|
||||
# you can run eg:
|
||||
#
|
||||
# mkdir initdb; echo "echo hi" > initdb/hi.sh
|
||||
# docker run -v $PWD/initdb:/docker-entrypoint-initdb.d solr
|
||||
#
|
||||
# and have your script execute before Solr 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
|
||||
|
||||
# execute files in /docker-entrypoint-initdb.d before starting solr
|
||||
while read -r f; do
|
||||
case "$f" in
|
||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
||||
*) echo "$0: ignoring $f" ;;
|
||||
esac
|
||||
echo
|
||||
done < <(find /docker-entrypoint-initdb.d/ -mindepth 1 -type f | sort -n)
|
||||
Reference in New Issue
Block a user