-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit_all_noriver.sh
executable file
·89 lines (67 loc) · 2.68 KB
/
init_all_noriver.sh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
## This script uses both Searchisko REST API and Elasticsearch http API to init Elasticsearch indices and DCP configurations. No rivers are installed.
##
## You can use first commandline parameter to change base URL for Searchisko API call (/v2/rest/... is appended automatically to this base URL). If not present then OPENSHIFT_APP_DNS system property is be used. Default is http://localhost:8080
## You can use second commandline parameter to change Searchisko admin username
## You can use third commandline parameter to change Searchisko admin password
## You can use fourth commandline parameter to define Elasticsearch http connector URL base. If not present then OPENSHIFT_JBOSSEAP_IP system property can be used to define IP/domainname part of URL (http protocol and port 15000 is used in this case). If not defined then default is: http://localhost:15000
## You can use optional fifth commandline parameter to define username for Elasticsearch http connector HTTP basic authentication
## You can use optional sixth commandline parameter to define password for Elasticsearch http connector HTTP basic authentication
clear
searchiskourl=http://localhost:8080
if [ -n "${OPENSHIFT_APP_DNS}" ]; then
searchiskourl=http://${OPENSHIFT_APP_DNS}
fi
if [ -n "$1" ]; then
searchiskourl=$1
fi
searchiskousername=jbossorg
if [ -n "$2" ]; then
searchiskousername=$2
fi
searchiskopassword=jbossorgjbossorg
if [ -n "$3" ]; then
searchiskopassword=$3
fi
esurl="http://localhost:15000"
if [ -n "${OPENSHIFT_JBOSSEAP_IP}" ]; then
esurl=http://${OPENSHIFT_JBOSSEAP_IP}:15000
fi
if [ -n "$4" ]; then
esurl=$4
fi
if [ -n "$5" ]; then
esusername=$5
fi
if [ -n "$6" ]; then
espassword=$6
fi
echo ========== Initializing Elasticsearch cluster ===========
echo Using Elasticsearch http connector URL base: ${esurl}
pushd index_templates/
./init_templates.sh ${esurl} ${esusername} ${espassword}
popd
pushd indexes/
./init_indexes.sh ${esurl} ${esusername} ${espassword}
popd
pushd mappings/
./init_mappings.sh ${esurl} ${esusername} ${espassword}
popd
echo ========== Initializing Searchisko ===========
echo Using Searchisko REST API URL base: ${searchiskourl}
pushd data/provider/
./init-providers.sh ${searchiskourl} ${searchiskousername} ${searchiskopassword}
popd
pushd data/config/
./init-config.sh ${searchiskourl} ${searchiskousername} ${searchiskopassword}
popd
pushd data/project/
./init-projects.sh ${searchiskourl} ${searchiskousername} ${searchiskopassword}
popd
pushd data/contributor/
./init-contributors.sh ${searchiskourl} ${searchiskousername} ${searchiskopassword}
popd
pushd data/query/
./init-queries.sh ${searchiskourl} ${searchiskousername} ${searchiskopassword}
popd
echo FINISHED!