-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwbsetup.sh
executable file
·42 lines (33 loc) · 1.13 KB
/
wbsetup.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
#!/bin/bash
#
# WebIT Cloud Services Toolkit - main deployment utility
#
# Copyright 2018-2019 Tamas Meszaros <[email protected]>
# Licensed under Mozilla Public License v2.0 http://mozilla.org/MPL/2.0/
#
echo "======= WebIT Cloud Services Toolkit deployment tool =========================="
WBROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NETDEV=$(ip route show |grep "default "|awk '{print $5}')
IPZONE=$(ip addr show ${NETDEV}|grep "inet "|awk '{print $2}')
IPADDR=$(echo $IPZONE | cut -d/ -f 1)
if [ "$1" == "-d" ]; then verbose=true; shift; fi
# Import common functions
. ${WBROOT}/setup/functions.sh
# Check requirements
. ${WBROOT}/setup/check-reqs.sh
# Check / create the setup and read environment variables
. ${WBROOT}/setup/setup.sh
# These are mandatory services, setup them if they are not running:
# Watchtower, Traefik
container_running $watchtower || services_install watchtower
container_running $traefik || services_install traefik
# Install a service profile (several containers at once)
if [ "$1" == "-p" ]; then
profile_install "$2"
fi
while true; do
services_menu
if [ "$?" != "0" ]; then
break;
fi
done