-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
43 lines (29 loc) · 1 KB
/
Makefile
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
36
37
38
39
40
41
42
43
.PHONY: *
.DEFAULT_GOAL := setup
.SILENT:
include $(shell test -f .env.local || cp .env.local.dist .env.local && echo .env.local)
export GOROOT ?= $(error "GOROOT is not defined, you may not have Go installed locally.")
export GOPATH ?= $(error "GOPATH is not defined, you may not have Go installed locally.")
export DOCKER_BUILDKIT=1
export TURBO_ENIGMA_IMAGE ?= codelicia/turbo-enigma:latest
setup: image/build test/unit analysis/revive app/run
image/build:
docker build -t ${TURBO_ENIGMA_IMAGE} .
app/run:
docker run -it --rm -p 8000:80 \
-e SLACK_TOKEN="${SLACK_TOKEN}" \
-e NOTIFICATION_RULES="${NOTIFICATION_RULES}" \
-e REACTION_RULES="${REACTION_RULES}" \
${TURBO_ENIGMA_IMAGE}
app/rerun: image/build app/run
style/fix:
go fmt ./...
test/unit:
go test ./...
coverage/generate:
go test ./... -coverprofile=coverage.out
coverage/view:
go tool cover -html=coverage.out
analysis/revive:
revive -version || go get -u github.com/mgechev/revive
revive -config=revive.toml -formatter=friendly ./...