-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathMakefile
124 lines (108 loc) · 3.39 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
IMAGE = leanlabs/kanban
TAG = 1.7.1
CWD = /go/src/gitlab.com/leanlabsio/kanban
all: clean
test:
@docker run -d -P --name selenium-hub selenium/hub:2.47.1
@docker run -d --link selenium-hub:hub selenium/node-chrome:2.47.1
@docker run -d --link selenium-hub:hub selenium/node-firefox:2.47.1
@docker run -d -P $(IMAGE):$(TAG)
@protractor $(CURDIR)/tests/e2e.conf.js
node_modules/: package.json
@docker run --rm \
-v $(CURDIR):$(CWD) \
-v $$HOME/node_cache:/cache \
-w $(CWD) \
-e HOME=/cache \
node:6.3.0-wheezy npm run install
build: node_modules/
@docker run --rm \
-v $(CURDIR):$(CWD) \
-v $$HOME/node_cache:/cache \
-w $(CWD) \
-e HOME=/cache \
node:6.3.0-wheezy npm run build
templates/templates.go: $(find $(CURDIR)/templates -name "*.html" -type f)
@docker run --rm \
-v $(CURDIR):$(CWD) \
-w $(CWD) \
leanlabs/go-bindata-builder \
$(DEBUG) \
-pkg=templates -o templates/templates.go \
templates/...
web/web.go: $(find $(CURDIR)/web/ -name "*" ! -name "web.go" -type f)
@docker run --rm \
-v $(CURDIR):$(CWD) \
-w $(CWD) \
leanlabs/go-bindata-builder \
$(DEBUG) \
-pkg=web -o web/web.go \
web/assets/... web/images/... web/template/...
rel/kanban_x86_64_linux: clean build templates/templates.go web/web.go $(find $(CURDIR) -name "*.go" -type f)
@docker run --rm \
-v $(CURDIR):$(CWD) \
-w $(CWD) \
-e GOOS=linux \
-e GOARCH=amd64 \
-e GO15VENDOREXPERIMENT=1 \
-e CGO_ENABLED=0 \
--entrypoint=/usr/local/go/bin/go \
golang:1.5.3 build -ldflags "-X main.AppVer=$(TAG) -s" -v -o $@
rel/kanban_x86_64_darwin: clean build templates/templates.go web/web.go $(find $(CURDIR) -name "*.go" -type f)
@docker run --rm \
-v $(CURDIR):$(CWD) \
-w $(CWD) \
-e GOOS=darwin \
-e GOARCH=amd64 \
-e GO15VENDOREXPERIMENT=1 \
-e CGO_ENABLED=0 \
--entrypoint=/usr/local/go/bin/go \
golang:1.5.3 build -ldflags "-X main.AppVer=$(TAG) -s" -v -o $@
release: rel/kanban_x86_64_linux
@docker build -t $(IMAGE) .
@docker tag $(IMAGE):latest $(IMAGE):$(TAG)
@docker push $(IMAGE):latest
@docker push $(IMAGE):$(TAG)
clean:
@rm -rf web/
@rm -f templates/templates.go
# Development targets
dev_redis:
@docker inspect -f {{.State.Running}} kb_dev_redis || \
docker run -d -p 6379:6379 --name kb_dev_redis leanlabs/redis
watch: build
@docker inspect -f {{.State.Running}} kb_dev_watcher || \
docker run -d \
--name kb_dev_watcher \
-v $(CURDIR):$(CWD) \
-v $$HOME/node_cache:/cache \
-w $(CWD) \
-e HOME=/cache \
node:6.3.0-wheezy npm run watch
tmp/go/pkg/:
@docker run --rm \
-v $(CURDIR)/tmp/go/pkg:/go/pkg \
-v $(CURDIR):$(CWD) \
-w $(CWD) \
-e GO15VENDOREXPERIMENT=1 \
--entrypoint=/usr/local/go/bin/go \
golang:1.5.3 install -v
dev : DEBUG=-debug
dev: watch templates/templates.go web/web.go dev_redis tmp/go/pkg/
-docker rm -f kb_dev
@docker run -d --link kb_dev_redis:redis --name kb_dev \
-p 9000:80 \
-v $(CURDIR):$(CWD) \
-v $(CURDIR)/tmp/go/pkg:/go/pkg \
-w $(CWD) \
-e GO15VENDOREXPERIMENT=1 \
-e KANBAN_GITLAB_URL=$(KANBAN_GITLAB_URL) \
-e KANBAN_ENABLE_SIGNUP=$(KANBAN_ENABLE_SIGNUP) \
-e KANBAN_SERVER_HOSTNAME=$(KANBAN_SERVER_HOSTNAME) \
-e KANBAN_GITLAB_CLIENT=$(KANBAN_GITLAB_CLIENT) \
-e KANBAN_GITLAB_SECRET=$(KANBAN_GITLAB_SECRET) \
-e KANBAN_REDIS_ADDR=redis:6379 \
-e KANBAN_AUTO_COMMENTS=false \
--entrypoint=/usr/local/go/bin/go \
golang:1.5.3 run -v main.go server
.PHONY: help test build release