diff --git a/Makefile b/Makefile index 11267cddcf..8dcbcbe1b6 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ bin: prep # into ./bin/ as well as $GOPATH/bin dev: prep @CGO_ENABLED=$(CGO_ENABLED) BUILD_TAGS='$(BUILD_TAGS)' VAULT_DEV_BUILD=1 sh -c "'$(CURDIR)/scripts/build.sh'" -dev-ui: prep +dev-ui: assetcheck prep @CGO_ENABLED=$(CGO_ENABLED) BUILD_TAGS='$(BUILD_TAGS) ui' VAULT_DEV_BUILD=1 sh -c "'$(CURDIR)/scripts/build.sh'" dev-dynamic: prep @CGO_ENABLED=1 BUILD_TAGS='$(BUILD_TAGS)' VAULT_DEV_BUILD=1 sh -c "'$(CURDIR)/scripts/build.sh'" @@ -42,7 +42,7 @@ dev-dynamic: prep dev-mem: BUILD_TAGS+=memprofiler dev-mem: dev dev-ui-mem: BUILD_TAGS+=memprofiler -dev-ui-mem: dev-ui +dev-ui-mem: assetcheck dev-ui dev-dynamic-mem: BUILD_TAGS+=memprofiler dev-dynamic-mem: dev-dynamic @@ -166,6 +166,10 @@ fmtcheck: fmt: gofmt -w $(GOFMT_FILES) +assetcheck: + @echo "==> Checking compiled UI assets..." + @sh -c "'$(CURDIR)/scripts/assetcheck.sh'" + spellcheck: @echo "==> Spell checking website..." @misspell -error -source=text website/source @@ -194,6 +198,6 @@ hana-database-plugin: mongodb-database-plugin: @CGO_ENABLED=0 go build -o bin/mongodb-database-plugin ./plugins/database/mongodb/mongodb-database-plugin -.PHONY: bin default prep test vet bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin static-assets ember-dist ember-dist-dev static-dist static-dist-dev +.PHONY: bin default prep test vet bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin static-assets ember-dist ember-dist-dev static-dist static-dist-dev assetcheck .NOTPARALLEL: ember-dist ember-dist-dev static-assets diff --git a/scripts/assetcheck.sh b/scripts/assetcheck.sh new file mode 100755 index 0000000000..30d3b4cb8b --- /dev/null +++ b/scripts/assetcheck.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +if [[ ! -e http/bindata_assetfs.go ]] +then + printf "Compiled UI assets not found. They can be built with: make static-dist\n\n" +else + if [[ `find http/bindata_assetfs.go -mmin +10080` ]] + then + printf "Compiled UI assets are more than one week old. They can be rebuilt with: make static-dist\n\n" + fi +fi