forked from fgallina/bookapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (31 loc) · 891 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
42
43
44
45
46
47
DOCKER ?= docker
DOCKER_COMPOSE ?= docker-compose
KUBECTL ?= kubectl
all: build
# Docker related commands
up: build-app
$(DOCKER_COMPOSE) up -d --build api
down:
$(DOCKER_COMPOSE) down
migrate:
$(DOCKER) exec bookapi_api_1 npm run knex migrate:latest
build-deps:
$(DOCKER) build -t bookapi-dependencies -f Dockerfile.dependencies .
build-app:
$(DOCKER) build -t bookapi -f Dockerfile.app .
build: build-deps build-app
# Kubernetes related commands
kube-build:
./scripts/build-images-in-minikube.sh
kube-deploy: kube-build
$(KUBECTL) apply -f deploy/
kube-migrate:
./scripts/run-migrate-in-pod.sh
kube-delete:
$(KUBECTL) delete -f deploy/
# General utilities
clean-db:
sudo rm -rf ./pgdata
clean: clean-db
rm -rf node_modules npm-debug.log
.PHONY: up, down, migrate; build-deps, build-app, build, kube-build, kube-deploy, kube-migrate, kube-delete, clean-db, clean