Add swagger validate build step

This commit is contained in:
Jannis Mattheis 2018-02-17 10:19:46 +01:00 committed by Jannis Mattheis
parent d965b4e44d
commit c76dffdd61
2 changed files with 12 additions and 0 deletions

View File

@ -12,14 +12,18 @@ before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- chmod +x ./all-test-with-coverage.sh
- chmod +x ./swagger-validate.sh
install:
- dep ensure
- go get github.com/golang/lint/golint
- go get honnef.co/go/tools/cmd/megacheck
- go get github.com/fzipp/gocyclo
- go get -u github.com/gobuffalo/packr/...
- go get -u github.com/go-swagger/go-swagger/cmd/swagger
script:
- ./swagger-validate.sh
- ./all-test-with-coverage.sh
- go vet ./...
- megacheck ./...

8
swagger-validate.sh Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
swagger generate spec --scan-models -o docs/spec.json
(cd docs && packr && git add .)
if [[ `git status --porcelain | grep docs` ]]; then
echo Swagger or the Packr file is not up-to-date
exit 1
fi