diff --git a/.gitignore b/.gitignore index cc931ff04..d83dce9e4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,11 +31,8 @@ conf profile/* public/resource/javascript/vue.js /gocron -gocron.exe /gocron-node -gocron-node.exe /bin /packages -node_modules -package.json \ No newline at end of file +node_modules \ No newline at end of file diff --git a/makefile b/makefile index 86cd4187f..ea233504c 100644 --- a/makefile +++ b/makefile @@ -1,22 +1,43 @@ -default: build .PHONY: build build: gocron node -.PHONY: gocron -gocron: +.PHONY: build-race +build-race: enable-race build + +.PHONY: run +run: build kill + ./bin/gocron-node & + ./bin/gocron web - go build -o bin/gocron ./cmd/gocron +.PHONY: run-race +run-race: enable-race run +.PHONY: kill +kill: + -killall gocron-node + +.PHONY: gocron +gocron: + go build $(RACE) -o bin/gocron ./cmd/gocron .PHONY: node node: + go build $(RACE) -o bin/gocron-node ./cmd/node + +.PHONY: test +test: + go test $(RACE) ./... - go build -o bin/gocron-node ./cmd/node +.PHONY: test-race +test-race: enable-race test + +.PHONY: enable-race +enable-race: + $(eval RACE = -race) .PHONY: clean clean: - rm bin/gocron - rm bin/gocron-node \ No newline at end of file + rm bin/gocron-node