-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.18 KB
/
Copy pathMakefile
File metadata and controls
47 lines (35 loc) · 1.18 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
36
37
38
39
40
41
42
43
44
45
46
47
DOCKER_RUN := docker run --rm -it -v $$PWD:/go/src/page-elements
SUPPORTED_ASSET_DIRS := templates
BUILDLESS_CONTAINERS := consul traefik
ELEMENTS = site page-home-v1 header footer recommendations navigation skeleton page-sub dashboard page-home-v2
.PHONY: vendor specs
up: up/consul up/traefik wait $(addprefix up/,$(ELEMENTS))
up/%: build/% stop/%
docker-compose up -d $*
stop:
docker-compose stop
stop/%:
docker-compose stop $*
build/%: ASSET_DIRS = $(addsuffix /..., $(filter $(SUPPORTED_ASSET_DIRS), $(subst $*/,, $(wildcard $*/*))))
build/%:
# run go-bindata
$(if $(ASSET_DIRS), $(DOCKER_RUN) -w /go/src/page-elements/$* dominikznidar/go-bindata $(ASSET_DIRS))
# build it
$(DOCKER_RUN) -w /go/src/page-elements/$* golang:1.7.4-alpine go build -o ../bin/micro-$*
build/consul: ;
build/traefik: ;
logs:
docker-compose logs -f --tail=0
# update local vendor folder
vendor:
$(DOCKER_RUN) -w /go/src/page-elements trifs/govendor:latest fetch +missing
$(DOCKER_RUN) -w /go/src/page-elements trifs/govendor:latest remove +unused
specs:
@$(MAKE) -C specs
clean:
rm bin/*
rm -f */bindata.go
docker-compose down
wait:
@echo "Wait for consul to wake up"
docker-compose up waitForConsul