-
Notifications
You must be signed in to change notification settings - Fork 2
/
admin.sh
executable file
·29 lines (24 loc) · 941 Bytes
/
admin.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
#!/bin/bash
source "system/lib.sh"
# Check for access to control docker
SUDO=''
if (( $EUID != 0 )); then
SUDO='sudo'
fi
pathServices="system/services"
# get all system services together when starting (exclude configuration folder)
SERVICES="-f $pathServices/docker-compose.yml"
for service in system/services/*; do
if [[ -d "$service" ]]; then
serviceName=$(basename "$service")
if [[ "$serviceName" == "$1" ]] && [[ -z "$2" ]]; then
editEnv "$pathServices/$serviceName/template.env" "system/configuration/.env" "interactive" "$serviceName"
runScript "$pathServices/$serviceName" "Setup" "multiproject" "$serviceName"
exit
else
runScript "$pathServices/$serviceName" "Build" "multiproject" "$serviceName"
SERVICES="$SERVICES -f $pathServices/$serviceName/docker-compose.yml"
fi
fi
done
$SUDO docker-compose --project-directory "system/configuration" -p "multiproject" $SERVICES $@