diff --git a/build.properties.d/00_default.properties b/build.properties.d/00_default.properties index 0ce20ba28dc6fb31a427d0c6aed04ff100f31457..046375fa9718c1acdc0a30cf46d488a8beaf3a2b 100644 --- a/build.properties.d/00_default.properties +++ b/build.properties.d/00_default.properties @@ -60,7 +60,14 @@ BUILD_FOOTER_DATA_POLICY_HREF=https://indiscale.com/?page_id=156 # Custom footer elements can be placed here (will be placed inside a <div> # element). BUILD_FOOTER_CUSTOM_ELEMENT_ONE= +# BUILD_FOOTER_CUSTOM_ELEMENT_ONE='<p>Some content <img +# src="/webinterface/${BUILD_NUMBER}/pics/some_image.png"/>' + +# Files from the `build.properties.files` directory can also be included here +# These files will also have a second step of variable substitution with +# ${BUILD_NUMBER}. BUILD_FOOTER_CUSTOM_ELEMENT_TWO= +# BUILD_FOOTER_CUSTOM_ELEMENT_TWO=$(cat footer_element_2.html) BUILD_CUSTOM_IMPRINT='<p> Put an imprint note here </p>' diff --git a/build.properties.files/footer_element_2.html b/build.properties.files/footer_element_2.html new file mode 100644 index 0000000000000000000000000000000000000000..f0444d4291772d585049257631f779b3282fd4e1 --- /dev/null +++ b/build.properties.files/footer_element_2.html @@ -0,0 +1,7 @@ +<h1>Put your template content files into this directory</h1> + +<p> + Files in this directory can be substituted into the variables defined in + build.properties.d. In a second step, parameter substitution takes place with + BUILD_NUMBER, if the word is preceded by a dollar sign: ${BUILD_NUMBER} +</p> diff --git a/makefile b/makefile index 712cd2e76b4963554de0a00d6cfb8e284b7bc547..d9091f32004cfe9c25e28c9e75a3cc18471ac73b 100644 --- a/makefile +++ b/makefile @@ -66,16 +66,20 @@ merge_xsl: build_properties: @set -a -e ; \ - for f in $$(ls build.properties.d/) ; do source "build.properties.d/$$f" ; done ; \ + pushd build.properties.files ; \ + for f in ../build.properties.d/* ; do source "$$f" ; done ; \ + popd ; \ BUILD_NUMBER=$(BUILD_NUMBER) ; \ PROPS=$$(printenv | grep -e "^BUILD_") ; \ echo "SET BUILD PROPERTIES:" ; \ for p in $$PROPS ; do echo " $$p" ; done; \ - VARS=$$(printenv | grep -e "^BUILD_" | sed 's/=.*$$/}/' | sed 's/^/$${/') ; \ + VARS=$$(printenv | grep -e "^BUILD_" | grep -v "^BUILD_NUMBER=" | \ + sed -E 's/(BUILD_[^=]+)=.*/$${\1}/') ; \ for f in $$(find $(PUBLIC_DIR) -type f) ; do \ echo "BUILD FILE: $$f" ; \ mv "$$f" "$${f}.tmp" ; \ - envsubst "$$VARS" < "$${f}.tmp" > "$$f" ; \ + envsubst "$$VARS" < "$${f}.tmp" | \ + envsubst "\$${BUILD_NUMBER}" > "$$f" ; \ rm "$${f}.tmp" ; \ done @echo $(BUILD_NUMBER) > $(PUBLIC_DIR)/.build_number