From 7e5745fe0eb400d3fbcbedc9adc5552273a6c7f6 Mon Sep 17 00:00:00 2001 From: Bjoern Rabenstein Date: Mon, 26 Jan 2015 15:10:27 +0100 Subject: [PATCH] Slim down the files we embed into the binary. - Use only the minified versions of bootstrap. - Do not embed non-minified bootstrap files and bootstrap map files. - Simplify the 'blob-stamp' Makefile contraption. --- utility/embed-static.sh | 3 ++- web/Makefile | 8 +++----- web/blob/Makefile | 1 + web/templates/_base.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/utility/embed-static.sh b/utility/embed-static.sh index 31a852d8d..86ddd208d 100755 --- a/utility/embed-static.sh +++ b/utility/embed-static.sh @@ -14,7 +14,8 @@ do cd "${dir}" echo "\"$(basename ${dir})\": {" - find . -type f | while read file + # Do not embed map files and the non-minified bootstrap files. + find . -type f \! -name \*.map \! -name bootstrap.js \! -name bootstrap-theme.css \! -name bootstrap.css | while read file do name=$(echo "${file}"|sed 's|\.\/||') echo "\"$name\": {" diff --git a/web/Makefile b/web/Makefile index 8b73782c8..275498c89 100644 --- a/web/Makefile +++ b/web/Makefile @@ -11,14 +11,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: blob-stamp +all: blob -blob-stamp: templates/* +blob: $(MAKE) -C blob - touch $@ clean: $(MAKE) -C blob clean - -rm -f *-stamp -.PHONY: clean +.PHONY: clean blob diff --git a/web/blob/Makefile b/web/blob/Makefile index 41e3159d9..fa532c8f4 100644 --- a/web/blob/Makefile +++ b/web/blob/Makefile @@ -17,6 +17,7 @@ all: files.go SUFFIXES: +# Do not embed map files and the non-minified bootstrap files. files.go: $(shell find ../templates/ ../static/ -type f) ../../utility/embed-static.sh ../static ../templates | $(GOFMT) > $@ diff --git a/web/templates/_base.html b/web/templates/_base.html index 4d494f4e0..da26e8082 100644 --- a/web/templates/_base.html +++ b/web/templates/_base.html @@ -5,7 +5,7 @@ Prometheus Time Series Collection and Processing Server - + {{template "head" .}}