-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 1.02 KB
/
Makefile
File metadata and controls
35 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SHELL := /bin/bash
.PHONY: help
## help: shows this help message
help:
@ echo "Usage: make [target]"
@ sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## up: starts the application exposing its HTTP port
up: clean
docker-compose up app
docker-compose down
## clean: clean up all docker containers
clean:
docker-compose down
docker ps -aq | xargs docker stop | xargs docker rm
## test: runs all tests
test:
docker-compose run test
## unit-test-ci: runs all tests on CI, with no Docker
unit-test-ci:
@go generate
@go test -v -race ./...
## lint: runs linter for a given directory, specified via PACKAGE variable
lint:
@ if [ -z "$(PACKAGE)" ]; then echo >&2 please set directory via variable PACKAGE; exit 2; fi
@ docker run --rm -v "`pwd`:/workspace:cached" -w "/workspace/$(PACKAGE)" golangci/golangci-lint:latest golangci-lint run
## lint-all: runs linter for all packages
lint-all:
@ docker run --rm -v "`pwd`:/workspace:cached" -w "/workspace/." golangci/golangci-lint:latest golangci-lint run