-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (40 loc) · 1.3 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
50
CONFIG=compose/development.yml
PROD_CONFIG=compose/production.yml
PROJECT=spacebeaver
DOCKERUSER=holdenk
VERSION=v0.0.4f
ifeq (shell, $(firstword $(MAKECMDGOALS)))
RUN_ARGS := $(lastword $(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
endif
.PHONY: format
format:
python -m black ./src
.PHONY: crossbuild
crossbuild:
docker buildx bake -f $(PROD_CONFIG) --progress=plain --set *.platform=linux/arm64,linux/amd64 --set app.tags.image=${DOCKERUSER}/$(PROJECT)-web:$(VERSION) app --push
.PHONY: up
up: export DOCKER_BUILDKIT := 1
up: export COMPOSE_DOCKER_CLI_BUILD=1
up:
@docker-compose -f $(CONFIG) -p $(PROJECT) up -d
.PHONY: stop
stop:
@docker-compose -f $(CONFIG) -p $(PROJECT) stop
.PHONY: rebuild
rebuild: export DOCKER_BUILDKIT := 1
rebuild: export COMPOSE_DOCKER_CLI_BUILD=1
rebuild:
@docker-compose -f $(CONFIG) -p $(PROJECT) down
@docker-compose -f $(CONFIG) -p $(PROJECT) pull --include-deps
@docker-compose -f $(CONFIG) -p $(PROJECT) build
.PHONY: shell
shell:
@docker-compose -f $(CONFIG) -p $(PROJECT) exec $(RUN_ARGS) /bin/bash
.PHONY: test
test: up
@docker-compose -f $(CONFIG) -p $(PROJECT) exec -T app make test
.PHONY: make-migrations
make-migrations: up
@docker-compose -f $(CONFIG) -p $(PROJECT) exec -T app make migrate
@docker-compose -f $(CONFIG) -p $(PROJECT) exec -T app make make-migrations