-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-nginx.sh
executable file
·41 lines (33 loc) · 1.04 KB
/
deploy-nginx.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
#!/bin/bash
cur_dir=$(pwd)
path_to_env="${cur_dir}/k8.env"
if [[ "${CLUSTER_CONFIG}" != "" ]]; then
path_to_env="${CLUSTER_CONFIG}"
fi
if [[ ! -e ${path_to_env} ]]; then
if [[ -e ${cur_dir}/../k8.env ]]; then
cur_dir=".."
path_to_env="${cur_dir}/k8.env"
else
echo "failed to find env file: ${path_to_env} with CLUSTER_CONFIG=${CLUSTER_CONFIG}"
exit 1
fi
fi
source ${path_to_env}
# defined in the CLUSTER_CONFIG
start_logger
env_name="${K8_ENV}"
use_repo="${REPO_BASE_DIR}"
debug="${METAL_DEBUG}"
tool_nginx_starter="$(dirname ${path_to_env})/nginx/run.sh"
anmt "----------------------------------------"
anmt "deploying nginx to ${env_name} with ${tool_nginx_starter} and KUBECONFIG=${KUBECONFIG}"
inf ""
${tool_nginx_starter}
if [[ "$?" != "0" ]]; then
err "failed to start nginx with ${tool_nginx_starter} and KUBECONFIG=${KUBECONFIG}"
exit 1
fi
good "done - deploying nginx to ${env_name} with ${tool_nginx_starter} and KUBECONFIG=${KUBECONFIG}"
anmt "----------------------------------------"
exit 0