2020-10-20 20:48:22 +02:00
|
|
|
.PHONY: prebuild clean cleanall server server-linux generate watch-server
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
all: server
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
prebuild:
|
|
|
|
go get github.com/gorilla/mux
|
|
|
|
go get github.com/gorilla/websocket
|
|
|
|
go get github.com/spf13/viper
|
|
|
|
go get github.com/lib/pq
|
|
|
|
go get github.com/mattn/go-sqlite3
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
server:
|
2020-10-17 20:48:54 +02:00
|
|
|
cd server; go build -o ../bin/octoserver ./main
|
2020-10-08 18:21:27 +02:00
|
|
|
|
2020-10-20 20:48:22 +02:00
|
|
|
server-linux:
|
|
|
|
cd server; env GOOS=linux GOARCH=amd64 go build -o ../bin/octoserver ./main
|
|
|
|
|
2020-10-18 01:17:17 +02:00
|
|
|
generate:
|
2020-10-21 09:56:03 +02:00
|
|
|
cd server; go get -modfile=go.tools.mod github.com/golang/mock/mockgen
|
|
|
|
cd server; go get -modfile=go.tools.mod github.com/jteeuwen/go-bindata
|
2020-10-18 01:17:17 +02:00
|
|
|
cd server; go generate ./...
|
|
|
|
|
2020-10-21 09:59:02 +02:00
|
|
|
server-lint:
|
|
|
|
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
|
|
|
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
cd server; golangci-lint run ./...
|
|
|
|
|
2020-10-21 22:23:01 +02:00
|
|
|
server-test:
|
|
|
|
cd server; go test ./...
|
|
|
|
|
2020-10-16 19:20:43 +02:00
|
|
|
watch-server:
|
|
|
|
cd server; modd
|
|
|
|
|
2020-10-08 18:21:27 +02:00
|
|
|
clean:
|
|
|
|
rm -rf bin
|
|
|
|
rm -rf dist
|
2020-10-20 20:48:22 +02:00
|
|
|
rm -rf webapp/pack
|
2020-10-08 18:21:27 +02:00
|
|
|
|
|
|
|
cleanall: clean
|
2020-10-20 20:48:22 +02:00
|
|
|
rm -rf webapp/node_modules
|