-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.01 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
NAME=spamhouse
IMAGE=$(NAME)
TEST_IMAGE=$(NAME)-test
DOCKERFILE=ci/Dockerfile
# This value matches the docker volume created in via docker-compose
VOL_NAME=data
PORT=8080
.PHONY: build
build:
@echo "--> building image: $(NAME)"
@docker build -t $(IMAGE) .
.PHONY: dev
dev: stop build run
.PHONY: run
run: stop
@echo "--> starting $(NAME) on port $(PORT)"
@PORT=$(PORT) docker-compose up spamhouse
.PHONY: stop
stop:
@echo "--> stopping $(NAME)"
@PORT=$(PORT) docker-compose down
.PHONY: regenerate
regenerate:
@echo "--> regenerating graphql resolvers"
@go generate ./...
.PHONY: test
test:
@echo "--> running go tests for $(NAME)"
@go test -v ./...
.PHONY: test-integration
test-integration: stop build
@echo "--> starting integration tests for $(TEST_IMAGE)"
@PORT=$(PORT) docker-compose up -d spamhouse
@docker build --target build1 -t $(TEST_IMAGE) .
@PORT=$(PORT) docker-compose up --remove-orphans test
.PHONY: db-shell
db-shell:
docker exec -it spamhouse sqlite3 /var/lib/sqlite/data/spamhouse.db