-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (32 loc) · 853 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
REBAR ?= ./rebar3
run:
_build/default/rel/loom/bin/loom foreground
release: | $(REBAR)
$(REBAR) release
$(REBAR):
wget -O"$@" https://s3.amazonaws.com/rebar3/rebar3
chmod +x "$@"
test:
$(MAKE) --keep-going -C tests wait test stop
clean:
rm -rf _build
DOCKER ?= docker
DOCKER_COMPOSE ?= docker-compose
DOCKER_REPO ?= rootmos/loom
ifneq ($(wildcard .git),)
export DOCKER_IMAGE ?= $(DOCKER_REPO):$(shell git rev-parse HEAD | head -c7)
else
export DOCKER_IMAGE ?= $(DOCKER_REPO):latest
endif
test-compose:
$(DOCKER_COMPOSE) build
$(DOCKER_COMPOSE) up --detach --force-recreate loom
$(DOCKER_COMPOSE) run tests
publish:
$(DOCKER) push $(DOCKER_IMAGE)
ifeq ($(TRAVIS_BRANCH),master)
$(DOCKER) tag $(DOCKER_IMAGE) $(DOCKER_REPO):latest
$(DOCKER) push $(DOCKER_REPO):latest
endif
.PHONY: run release clean test
.PHONY: test-compose publish