-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
executable file
·60 lines (51 loc) · 1.26 KB
/
deploy.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
#!/bin/bash
echo "Setting the environment variables for the docker-compose file..."
echo
APPLIST="apps.conf"
# Read apps.conf and set the environment variable as a single line
# comma seperated list to install all the apps
set_app_list ()
{
APPJOINED=`cat ${APPLIST} |tr '\n' ',' |sed 's/,$//'`
export SPLUNK_APPS_URL=${APPJOINED}
echo "Configured the list of apps to be installed."
echo
}
# Read the Splunkbase username/password to download the apps
set_splunkbase_credentials ()
{
echo -n "Splunkbase username: "
read splunkbase_user
export SPLUNKBASE_USERNAME=${splunkbase_user}
echo
echo -n "Splunkbase Password: "
read -s splunkbase_pass
export SPLUNKBASE_PASSWORD=${splunkbase_pass}
echo
}
# Set the Splunk admin password during deployment
set_splunk_password ()
{
echo -n "Splunk Password: "
read -s splunk_pass
export SPLUNK_PASSWORD=${splunk_pass}
echo
}
case "$1" in
apps)
set_app_list
;;
splunkbase)
set_splunkbase_credentials
;;
password)
set_splunk_password
;;
all)
set_app_list
set_splunkbase_credentials
set_splunk_password
;;
esac
echo "Environment set. Run 'docker-compose up -d' to start Splunk"
echo