-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
executable file
·37 lines (29 loc) · 939 Bytes
/
setup.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
#!/bin/bash
ROOT=$(dirname "$0")
NGINX_DIR=$ROOT/nginx
NGINX_CONFIG=$NGINX_DIR/nginx.conf
SHINYPROXY_DIR=$ROOT/shinyproxy
SHINYPROXY_CONFIG=$SHINYPROXY_DIR/application.yml
SHINY_APPS_DIR=$SHINYPROXY_DIR/shiny-apps
msg () {
COL='\033[0;33m'
NO_COL='\033[0m' # No Color
echo -e "\n${COL}$@${NO_COL}"
}
# Prepare config files --------------------------------------------------------
msg "Preparing Nginx and ShinyProxy config files from default..."
copyDefault () {
if [[ -f "$1" ]]; then
mv $1 $1.bkp
msg " - File $1 already existed and was renamed $1.bkp"
fi
cp $1.default $1
}
copyDefault $NGINX_CONFIG
copyDefault $SHINYPROXY_CONFIG
# Building necessary Docker images --------------------------------------------
msg "Preparing Docker images for services..."
docker compose pull
docker compose build
msg "Preparing Docker images for ShinyProxy apps..."
./${SHINYPROXY_DIR}/setup-shinyproxy.sh