-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·49 lines (44 loc) · 1.18 KB
/
setup
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
#!/bin/bash
set -euo pipefail
directory="$(dirname -- "$(readlink -f -- "$0" || greadlink -f -- "$0")")"
source "$directory/docker/utilities/common"
source "$directory/docker/utilities/domain"
source "$directory/docker/utilities/profiles"
source "$directory/docker/utilities/env"
check_required_commands "docker"
update_env "$directory/docker/.env" "WORKING_DIR" "$directory"
if [ $# -eq 0 ]; then
echo -e "${RED}Error: No command provided.${NC}"
exit 1
fi
case "$1" in
permissions|perm|permisson)
assign_permissions
echo -e "${GREEN}Permissions has been assigned.${NC}"
;;
domain)
while true; do
configure_server
read -e -r -p "$(echo -e "${YELLOW}Do you want to configure another site? (y/n):${NC}") " CONTINUE
if [[ "$CONTINUE" != "y" ]]; then
break
fi
done
echo -e "${GREEN}All configurations have been completed.${NC}"
;;
profiles)
prompt_common_vars
for service in "${!services_and_profiles[@]}"; do
process_service "$service"
done
echo -e "${GREEN}Setup completed.${NC}"
;;
env)
env_file="$directory/.env"
target="${2:-}"
if [ "$target" = "docker" ]; then
env_file="$directory/docker/.env"
fi
process_env_file "$env_file"
;;
esac