diff --git a/.travis.yml b/.travis.yml index cad4568d..9430d547 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,9 @@ install: - echo "TRAVIS_GO_VERSION=$TRAVIS_GO_VERSION" - dep status -v +before_script: + - make validate-doc + after_success: - make clean diff --git a/Makefile b/Makefile index 473af5d2..745012d5 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,17 @@ docs-serve: generate-dns docs-themes: @make -C ./docs hugo-themes -# Generate DNS -.PHONY: generate-dns +# DNS Documentation +.PHONY: generate-dns validate-doc generate-dns: go generate ./... + +validate-doc: generate-dns +ifneq ($(shell git status --porcelain -- ./docs/ ./cmd/ 2>/dev/null),) + @echo 'The documentation must be regenerated, please use `make generate-dns`.' + @git status --porcelain -- ./docs/ ./cmd/ 2>/dev/null + @exit 2 +else + @echo 'All documentation changes are done the right way.' +endif