Eugenio Romano 742c103cc0
Deploy PR on request (#5642)
* deploy PR on request

* [create peview]

* [create peview]

* script fix [create preview]

* [create peview]

* change creation preview

* [create peview]

* Update deploy-pr.sh

* [create peview]

* update node and dist

* [create peview]

* [create peview]

* [create peview]

* [create peview]

* [create peview]

* [create peview]

* [create peview]

* [create preview]

* subfolder issue

* [create preview]

* [create preview]

* [create preview]

* [create preview]

* [create preview]

* [create preview]
2020-05-10 18:32:47 +01:00

67 lines
1.9 KiB
Bash

#!/bin/sh
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
replace="\/"
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
-i ./app.config.json
fi
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
replace="\/"
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
-i ./app.config.json
fi
if [[ $ACSURL ]]; then
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
fi
if [ -n "${APP_BASE_SHARE_URL}" ];then
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
-i ./app.config.json
fi
if [[ -n "${BASE_PATH}" ]]
then
sed s%href=\"/\"%href=\""${BASE_PATH}"\"%g \
-i ./index.html
fi
nginx -g "daemon off;"