forked from leanlabsio/kanban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
131 lines (114 loc) · 3.57 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
125
126
127
128
129
130
131
IMAGE = leanlabs/kanban
TAG = 1.6.0
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 \
leanlabs/npm-builder:latest npm install
bower_components/: bower.json
@docker run --rm \
-v $(CURDIR):$(CWD) \
-v $$HOME/node_cache:/cache \
-w $(CWD) \
-e HOME=cache \
leanlabs/npm-builder bower install --allow-root
build: node_modules/ bower_components/
@docker run --rm \
-v $(CURDIR):$(CWD) \
-v $$HOME/node_cache:/cache \
-w $(CWD) \
-e HOME=/cache \
leanlabs/npm-builder grunt 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 \
leanlabs/npm-builder grunt 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 \
--entrypoint=/usr/local/go/bin/go \
golang:1.5.3 run -v main.go server
.PHONY: help test build release