-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathexport_env_vars.sh
More file actions
executable file
·64 lines (51 loc) · 1.63 KB
/
export_env_vars.sh
File metadata and controls
executable file
·64 lines (51 loc) · 1.63 KB
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
#!/usr/bin/env bash
# Enable strict mode (without -e to avoid exit-on-error)
set -uo pipefail
# Support being sourced in shells where BASH_SOURCE is unset (e.g. zsh)
SCRIPT_SOURCE="${BASH_SOURCE[0]-$0}"
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_SOURCE")" && pwd)"
SCRIPT_NAME="$(basename "$SCRIPT_SOURCE")"
echo "🔧 Running $SCRIPT_NAME..."
set -a
DEPLOY_DIR="$SCRIPT_DIR"
SECURITY_DIR="$SCRIPT_DIR/../security/env"
SERVICES_DIR="$SCRIPT_DIR/../services"
env_files=(
"$SECURITY_DIR/certificates_nifi.env"
"$SECURITY_DIR/certificates_general.env"
"$SECURITY_DIR/certificates_elasticsearch.env"
"$SECURITY_DIR/users_elasticsearch.env"
"$SECURITY_DIR/users_database.env"
"$SECURITY_DIR/users_nifi.env"
"$SECURITY_DIR/users_nginx.env"
"$DEPLOY_DIR/general.env"
"$DEPLOY_DIR/nifi.env"
"$DEPLOY_DIR/elasticsearch.env"
"$DEPLOY_DIR/database.env"
"$DEPLOY_DIR/network_settings.env"
"$DEPLOY_DIR/project.env"
"$DEPLOY_DIR/gitea.env"
"$DEPLOY_DIR/nginx.env"
"$DEPLOY_DIR/telemetry.env"
"$SERVICES_DIR/cogstack-jupyter-hub/env/jupyter.env"
"$SERVICES_DIR/ocr-service/env/ocr_service.env"
"$SERVICES_DIR/cogstack-nlp/medcat-service/env/app.env"
"$SERVICES_DIR/cogstack-nlp/medcat-service/env/medcat.env"
"$SERVICES_DIR/cogstack-nlp/medcat-trainer/envs/env-prod"
)
for env_file in "${env_files[@]}"; do
if [ -f "$env_file" ]; then
echo "✅ Sourcing $env_file"
# shellcheck disable=SC1090
source "$env_file"
else
echo "⚠️ Skipping missing env file: $env_file"
fi
done
# for nginx vars
export DOLLAR="$"
# Disable auto-export
set +a
# Restore safe defaults for interactive/dev shell
set +u
set +o pipefail