-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (50 loc) · 1.65 KB
/
Makefile
File metadata and controls
70 lines (50 loc) · 1.65 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
default: freyr
.PHONY: freyr surtr
pwd := $(shell pwd)
contdir := /go/src/github.com/serdmanczyk/freyr/
static_build_prefix := GO15VENDOREXPERIMENT=1 docker run \
-e CGO_ENABLED=0 \
-e GOOS=linux \
-e "GOPATH=$(contdir)vendor:/go" \
-v $(pwd):$(contdir)
static_build_args := golang go build -ldflags "-s" -a -installsuffix cgo -o
ymlbase := -f docker-compose.yml
ymldebug := -f docker-compose.debug.yml
ymlint := -f docker-compose.integration.yml
ymlacc := -f docker-compose.acceptance.yml
ymlprod := -f docker-compose.prod.yml
filesdebug := $(ymlbase) $(ymldebug)
filesint := $(ymlbase) $(ymldebug) $(ymlint)
filesacc := $(ymlbase) $(ymldebug) $(ymlacc)
filesprod := $(ymlbase) $(ymlprod)
int_params := go test $$(go list ./... | grep -v vendor) -tags=integration
projdebug := -p debug
projint := -p integration
projacc := -p acceptance
freyr:
$(static_build_prefix) -w $(contdir) $(static_build_args) freyr
surtr:
$(static_build_prefix) -w $(contdir)cmd/surtr $(static_build_args) surtr
web:
cd static && webpack
docker:
docker-compose $(filesprod) build
debug:
docker-compose $(filesdebug) $(projdebug) up freyr
integration:
docker-compose $(filesint) $(projint) run freyr $(int_params)
acceptance:
docker-compose $(filesacc) $(projacc) run surtr
down: testdown
docker-compose $(filesdebug) $(projdebug) down
prod:
docker-compose $(filesprod) up -d
proddown:
docker-compose $(filesprod) down
testdown:
docker-compose $(filesint) $(projint) down
docker-compose $(filesacc) $(projacc) down
docker ps -a | grep acceptance | awk '{print $$1}' | xargs docker rm
# all: freyr surtr web docker
all: freyr surtr docker
test: integration acceptance testdown