-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_bootstrap
executable file
·67 lines (51 loc) · 3.4 KB
/
install_bootstrap
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
#!/usr/bin/env sh
# Created by Solomon Shorser
# Hacked by Denis Yuen
set -o errexit
set -o pipefail
set -o nounset
# When changing these versions, you will probably need to delete all files in the working directory
# except for the dockstore_launcher_config directory in order to get a clean new copy of
# the Docker compose templates
cat <<MSG
DOCKSTORE INSTALLATION BOOTSTRAPPER
-----------------------------------------------------------------------------
MSG
function template()
{
# Place the config files into specific directories so they can be mounted to container paths as bind mounts
NGINX_CONF_DIRECTORY="config/nginx-conf"
NGINX_HTML2_DIRECTORY="config/nginx-html2"
WEBSERVICE_DIRECTORY="config/webservice"
mkdir -p ${NGINX_CONF_DIRECTORY}
mkdir -p ${NGINX_HTML2_DIRECTORY}
mkdir -p ${WEBSERVICE_DIRECTORY}
# Download index.html for UI we will be serving
wget -qO ${NGINX_HTML2_DIRECTORY}/index.html https://gui.dockstore.org/${UI2_HASH}/index.html
wget -qO ${NGINX_HTML2_DIRECTORY}/manifest.json https://gui.dockstore.org/${UI2_HASH}/manifest.json
mustache dockstore_launcher_config/compose.config templates/robots.txt.template > ${NGINX_HTML2_DIRECTORY}/robots.txt
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.conf
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.shared.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.shared.conf
mustache dockstore_launcher_config/compose.config templates/default.nginx_http.security.conf.template > ${NGINX_CONF_DIRECTORY}/default.nginx_http.security.conf
mustache dockstore_launcher_config/compose.config templates/web.yml.template > ${WEBSERVICE_DIRECTORY}/web.yml
mustache dockstore_launcher_config/compose.config templates/init_webservice.sh.template > ${WEBSERVICE_DIRECTORY}/init_webservice.sh
mustache dockstore_launcher_config/compose.config templates/init_migration.sh.template > ${WEBSERVICE_DIRECTORY}/init_migration.sh
chmod a+rx ${WEBSERVICE_DIRECTORY}/init_webservice.sh
chmod a+rx ${WEBSERVICE_DIRECTORY}/init_migration.sh
mustache dockstore_launcher_config/compose.config templates/elasticsearch.yml > config/elasticsearch.yml
mustache dockstore_launcher_config/compose.config templates/metricbeat.yml > config/metricbeat.yml
mustache dockstore_launcher_config/compose.config templates/essnapshot_backup.sh > scripts/essnapshot_backup.sh
mustache dockstore_launcher_config/compose.config templates/jvm.options.es.template > config/jvm.options.es
mustache dockstore_launcher_config/compose.config templates/jvm.options.dockstore.es.template > config/jvm.options.dockstore.es
mustache dockstore_launcher_config/compose.config templates/jvm.options.logstash.template > config/jvm.options.logstash
mustache dockstore_launcher_config/compose.config templates/postgres_backup.sh.template > scripts/postgres_backup.sh
chmod a+rx scripts/postgres_backup.sh
mkdir -p config/rules
for f in $(ls templates/rules/); do mustache dockstore_launcher_config/compose.config templates/rules/$f > config/rules/$f; done
}
#Read the config file if it exists
if [ -f dockstore_launcher_config/compose.config ] ; then
source <(jq -r 'to_entries|map("\(.key)=\"\(.value|tostring)\"")|.[]' dockstore_launcher_config/compose.config)
fi
template
echo "Exiting now."