-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (40 loc) · 951 Bytes
/
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
44
45
46
47
48
49
50
HEROKU=$(shell which heroku)
goos_opt=GOOS=$(GOOS)
goarch_opt=GOARCH=$(GOARCH)
out=reviewer-notification
out_opt="-o $(out)"
slack_webhook_url=http://localhost
auth_token=token
labels=S-awaiting-review
map="ara-ta3:arata,hogehoge:fugafuga"
post_to_channel=
port=8080
host=localhost
path=
url=http://$(host):$(port)/$(path)
run/binary: build_for_local
./$(out)
run:
env SLACK_WEBHOOK_URL=$(slack_webhook_url) \
TOKEN=$(auth_token) \
TARGET_LABELS=$(labels) \
ACCOUNT_MAP=$(map) \
SLACK_CHANNEL=$(post_to_channel) \
PORT=$(port) \
go run main.go
curl:
curl -i $(url)
curl/post:
curl -i $(url) -d '$(shell cat ./sample.json)' -X POST
build:
$(goos_opt) $(goarch_opt) go build $(out_opt)
build_for_linux:
$(MAKE) build GOOS=linux GOARCH=amd64 out_opt=""
build_for_local:
$(MAKE) build goos_opt= goarch_opt= out_opt=
deploy:
git push heroku master
open:
$(HEROKU) open
$(GOVENDOR):
go get -u github.com/kardianos/govendor