-
Notifications
You must be signed in to change notification settings - Fork 0
/
replace_hb_web_server_static_var.sh
40 lines (33 loc) · 2.09 KB
/
replace_hb_web_server_static_var.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
#!/bin/bash
echo "Replacing static placeholders with environment variables"
cd /usr/share/nginx/html
echo 'Using environment variables:'
echo 'API_PORT: ' $API_PORT
echo 'WORKER_PORT: ' WORKER_PORT
echo 'API_SUBDOMAIN: ' $API_SUBDOMAIN
echo 'WORKER_SUBDOMAIN: ' WORKER_SUBDOMAIN
echo 'DOMAIN: ' $DOMAIN
echo 'API_PROTOCOL: ' $API_PROTOCOL
echo 'WEBSOCKET_SERVER_APP_ENDPOINT: ' $WEBSOCKET_SERVER_APP_ENDPOINT
echo 'WORKER_SERVER_SUBDOMIAN: ' $WORKER_SUBDOMAIN
echo 'DOCMANAGER_BASE_URL: ' $DOCMANAGER_BASE_URL
echo 'DOC_GDS_API_KEY: ' $DOC_GDS_API_KEY
echo 'DOC_AUTH_TOKEN: ' $DOC_AUTH_TOKEN
echo 'GDS_API_KEY: ' $GDS_API_KEY
echo 'GDS_BASE_URL: ' $GDS_BASE_URL
echo 'FILE_APP_ID: ' $FILE_APP_ID
echo 'MINICHARM_BASE_URL: ' $MINICHARM_BASE_URL
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_API_PORT|'"$API_PORT"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_API_SUBDOMAIN|'"$API_SUBDOMAIN"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_API_DOMAIN|'"$DOMAIN"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_API_PROTOCOL|'"$API_PROTOCOL"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_APP_ENDPOINT|'"$WEBSOCKET_SERVER_APP_ENDPOINT"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_APP_WORKER_SUBDOMAIN|'"$WORKER_SUBDOMAIN"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_DOCMANAGER_BASE_URL|'"$DOCMANAGER_BASE_URL"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_DOC_GDS_API_KEY|'"$DOC_GDS_API_KEY"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_DOC_AUTH_TOKEN|'"$DOC_AUTH_TOKEN"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_GDS_API_KEY|'"$GDS_API_KEY"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_GDS_BASE_URL|'"$GDS_BASE_URL"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_FILE_APP_ID|'"$FILE_APP_ID"'|g' {} \;
find . -type f -exec sed -i 's|STATICSET_VALUE_PLACEHOLDER_MINICHARM_BASE_URL|'"$MINICHARM_BASE_URL"'|g' {} \;
echo "Replaced all placeholders. Exiting replace script.."