Skip to content

Commit

Permalink
build: Rework backend build process
Browse files Browse the repository at this point in the history
During `make backend` we want to regenerate the generated files, check
if all the packages can be built, if all the tests in all the packages
can be built (this is a hack, explained in an earlier commit), if all
the code passes linter checks, and that the go modules are not a mess.
  • Loading branch information
krnowak committed Nov 18, 2019
1 parent 83dfb4c commit f86224d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ frontend-watch:
cd frontend && npx webpack --watch-poll 1000 --watch --config ./webpack.config.js --mode development

.PHONY: backend
backend:
backend: tools/go-bindata tools/golangci-lint
PATH="$(abspath tools):$${PATH}" go generate ./...
# this is to get nice error messages when something doesn't
# build (both the project and the tests), golangci-lint's
# output in this regard in unreadable.
go build ./...
NEBRASKA_SKIP_TESTS=1 go test ./... >/dev/null
./tools/golangci-lint run --fix
go mod tidy
go build -o bin/nebraska ./cmd/nebraska

.PHONY: tools
Expand All @@ -34,10 +42,8 @@ tools:
tools/go-bindata: go.mod go.sum
go build -o tools/go-bindata github.com/kevinburke/go-bindata/go-bindata

.PHONY: bindata
bindata: tools/go-bindata
PATH="$(abspath tools):$${PATH}" go generate ./...
gofmt -s -w pkg/api/bindata.go
tools/golangci-lint: go.mod go.sum
go build -o ./tools/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint

.PHONY: container-nebraska
container-nebraska:
Expand Down

0 comments on commit f86224d

Please sign in to comment.