-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·53 lines (41 loc) · 1.15 KB
/
setup.sh
File metadata and controls
executable file
·53 lines (41 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
if [[ ! -f ./solr.env ]];then
cp ./solr.env.example solr.env
fi
if [[ ! -f ./env ]]; then
>&2 echo "ERROR cannot find ./env";
exit;
fi
source ./env
echo "SOLR_VERSION : ${SOLR_VERSION}"
echo "SOLR_SCHEMA : ${SOLR_SCHEMA}"
echo "SOLR_INDEX : ${SOLR_INDEX}"
echo "IMAGE_NAME : ${IMAGE_NAME}"
echo "RG_SOLR_JAR : ${RG_SOLR_JAR}"
echo "SOLR_UID : ${SOLR_UID}"
echo "---"
SOLR_INDEX_DIR="./index_schemas/${SOLR_SCHEMA}"
if [[ ! -d "${SOLR_INDEX_DIR}" ]]; then
>&2 echo "ERROR INDEX NOT FOUND : ${SOLR_INDEX_DIR}"
exit 10;
fi
SOLR_INDEX_FILE="${SOLR_INDEX_DIR}/index"
if [[ ! -f "${SOLR_INDEX_FILE}" ]]; then
>&2 echo "ERROR INDEX FILE NOT FOUND : ${SOLR_INDEX_FILE}"
exit 10;
fi
echo ""
echo "${SOLR_INDEX_FILE}:"
cat "${SOLR_INDEX_FILE}"|grep -v "^#"
echo ""
read -p "your current solr database will be erased. Are you sure you want to proceed? (yes/no): " user_response
if [[ "$user_response" != "yes" ]]; then
echo "Operation cancelled by user."
exit 1
fi
docker.sh stop
docker.sh remove
env VERSION=${SOLR_VERSION} ./prepareData.sh --clean
docker.sh solr_start
sleep 2
./devel-init-index.sh "${SOLR_INDEX}"