Add UI asset file checks to Makefile (#6428)

This commit is contained in:
Jim Kalafut
2019-03-25 12:07:14 -05:00
committed by GitHub
parent 6da6250754
commit 01a6c5c976
2 changed files with 18 additions and 3 deletions

View File

@@ -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

11
scripts/assetcheck.sh Executable file
View File

@@ -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