-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
49 lines (40 loc) · 1.06 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
PROJECT := wai-middleware-validation
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
GHC_VER := 8.8
RESOLVER := lts-16.31
NAMESPACE := kyotsuya
BASE_IMAGE := $(NAMESPACE)/$(PROJECT)-test:$(RESOLVER)
export COMPOSE_PROJECT_NAME := $(PROJECT)-$(BRANCH)
.PHONY: env
env:
@echo "PROJECT=$(PROJECT)"
@echo "BRANCH=$(BRANCH)"
@echo "GHC_VER=$(GHC_VER)"
@echo "RESOLVER=$(RESOLVER)"
@echo "NAMESPACE=$(NAMESPACE)"
@echo "BASE_IMAGE=$(BASE_IMAGE)"
@echo "COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME)"
.PHONY: base
base:
docker build -t $(BASE_IMAGE) --progress plain --build-arg GHC_VER=$(GHC_VER) --build-arg RESOLVER=$(RESOLVER) ./docker/test-base
.PHONY: base-bash
base-bash:
docker run -it --rm $(BASE_IMAGE) /bin/bash
.PHONY: base-push
base-push:
docker push $(BASE_IMAGE)
.PHONY: build
build:
docker-compose build --progress plain --build-arg BASE_IMAGE=$(BASE_IMAGE)
.PHONY: test
test: build
docker-compose run --rm dev stack test
.PHONY: bash
bash:
docker-compose run --rm dev /bin/bash
.PHONY: ps
ps:
docker-compose ps
.PHONY: down
down:
docker-compose down