Skip to content
Snippets Groups Projects
Commit 0a0c3973 authored by Quazgar's avatar Quazgar Committed by Henrik tom Wörden
Browse files

Enhanced makefile

parent 3ea723ca
No related branches found
No related tags found
No related merge requests found
......@@ -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>'
<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>
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment