forked from pablowilliam/New_Izing_Intalador-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
izing
92 lines (78 loc) · 2.15 KB
/
izing
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
# reset shell colors
tput init
# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$PROJECT_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
PROJECT_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
# required imports
source "${PROJECT_ROOT}"/variables/manifest.sh
source "${PROJECT_ROOT}"/utils/manifest.sh
source "${PROJECT_ROOT}"/lib/manifest.sh
# user configs file
if [[ ! -e "${PROJECT_ROOT}"/config ]]; then
cat << EOF > "${PROJECT_ROOT}"/config
deploy_password=${deploy_password}
postgres_root_password=${postgres_root_password}
db_pass=${db_pass}
EOF
fi
# this file has passwords
sudo su - root <<EOF
chown root:root "${PROJECT_ROOT}"/config
chmod 700 "${PROJECT_ROOT}"/config
EOF
source "${PROJECT_ROOT}"/config
# interactive CLI
inquiry_options
# system config
system_create_user
# dependencies related
system_update
system_node_install
system_pm2_install
system_docker_install
system_puppeteer_dependencies
system_snapd_install
system_nginx_install
system_certbot_install
# backend related
backend_chrome
system_git_clone
backend_set_env
backend_fix_login
backend_postgres_create
backend_redis_create
backend_rabbitmq_create
backend_portainer_create
backend_node_dependencies
backend_node_build
backend_db_migrate
backend_db_seed
backend_start_pm2
backend_nginx_setup
# frontend related
frontend_set_env
frontend_serverjs_setup
frontend_node_dependencies
frontend_node_quasar
frontend_node_build
frontend_start_pm2
frontend_nginx_setup
# adminfrontend related
admin-frontend_quasarconf_setup
admin-frontend_serverjs_setup
admin-frontend_node_dependencies
admin-frontend_node_build
admin-frontend_start_pm2
admin-frontend_nginx_setup
# network related
system_nginx_conf
system_nginx_restart
system_certbot_setup
# end install
system_success