Skip to content

Commit

Permalink
Tidy up makefile, add mongo shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
maxekman committed Mar 31, 2020
1 parent f629f3b commit 072a7c4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Makefile
@@ -1,35 +1,39 @@
default: services test

.PHONY: test
test:
go test ./...
.PHONY: test

.PHONY: test_docker
test_docker:
docker-compose run --rm golang make test
.PHONY: test_docker

.PHONY: cover
cover:
go list -f '{{if len .TestGoFiles}}"go test -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"{{end}}' ./... | xargs -L 1 sh -c
.PHONY: cover

.PHONY: publish_cover
publish_cover: cover
go get -d golang.org/x/tools/cmd/cover
go get github.com/modocache/gover
go get github.com/mattn/goveralls
gover
@goveralls -coverprofile=gover.coverprofile -service=travis-ci -repotoken=$(COVERALLS_TOKEN)
.PHONY: publish_cover

.PHONY: services
services:
docker-compose pull mongo redis gpubsub
docker-compose up -d mongo redis gpubsub
.PHONY: services

.PHONY: stop
stop:
docker-compose down
.PHONY: stop

.PHONY: clean
clean:
@find . -name \.coverprofile -type f -delete
@rm -f gover.coverprofile
.PHONY: clean

.PHONY: mongo_shell
mongo_shell:
docker run -it --network eventhorizon_default --rm mongo:4.2 mongo --host mongo test

0 comments on commit 072a7c4

Please sign in to comment.