diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-06 16:16:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-06 16:16:10 +0200 |
| commit | 375f329d6b276f802aafc14ce90520e807398d6e (patch) | |
| tree | 69f1a0edf7223e42e143e2d1d094c6eaaad0c400 /opendc-web/opendc-web-ui/scripts/envsubst-html.sh | |
| parent | e1d892bcbaa7e8361c150f684ca6a0dc5e036a87 (diff) | |
| parent | d4eb8ccd4f5d93d9e858b9c3ed6ff48763e68820 (diff) | |
chore: Prepare for OpenDC 2.0 release (v2)
This pull request performs several preparations for the official release of OpenDC 2.0.
With this pull request, we focus on the deployment of OpenDC to DockerHub and Maven Central.
* Add workflow for creating releases on Github and publishing to Maven Central
* Add workflow for publishing images on DockerHub
* Add support for runtime variables in frontend Docker image
* Add support for building Dokka documentation
Diffstat (limited to 'opendc-web/opendc-web-ui/scripts/envsubst-html.sh')
| -rwxr-xr-x | opendc-web/opendc-web-ui/scripts/envsubst-html.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/scripts/envsubst-html.sh b/opendc-web/opendc-web-ui/scripts/envsubst-html.sh new file mode 100755 index 00000000..8ca12e8a --- /dev/null +++ b/opendc-web/opendc-web-ui/scripts/envsubst-html.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +# We can use simple version of envsubst execution as +# envsubst < /usr/share/nginx/html/index.html.template > /usr/share/nginx/html/index.html +# but it replaces everything that looks like environment variable substitution +# so it affects `default values` approach. +# we need to replace only provided environment variables. + +auto_envsubst() { + template_path="/usr/share/nginx/html/index.html.template" + output_path="/usr/share/nginx/html/index.html" + defined_envs=$(printf '${%s} ' $(env | cut -d= -f1)) + envsubst "$defined_envs" < "$template_path" > "$output_path" +} + +auto_envsubst +exit 0 |
