-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (27 loc) · 1001 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
DOCKER_IMAGE_NAME=alura/bank
HEROKU_APP_NAME=alura-bank
docker/build:
@ docker image build -t $(DOCKER_IMAGE_NAME):$(tag) .
docker/retag/heroku:
@ docker tag $(DOCKER_IMAGE_NAME):$(tag) registry.heroku.com/$(HEROKU_APP_NAME)/web
@ docker push registry.heroku.com/$(HEROKU_APP_NAME)/web
local/up: local/down
@ docker-compose up -d
local/ls:
@ docker-compose ps
local/down:
@ docker-compose down
local/logs:
@ docker-compose logs -f $(service)
lint:
@ ./mvnw verify -DskipTests -Djacoco.skip=true
test:
@ ./mvnw test
deploy:
make _deploy_heroku auth_token=$(auth_token) image_id=$(shell docker inspect registry.heroku.com/$(HEROKU_APP_NAME)/web -f "{{.Id}}")
_deploy_heroku:
curl -X PATCH https://api.heroku.com/apps/$(HEROKU_APP_NAME)/formation \
-H "Authorization: Bearer $(auth_token)" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.heroku+json; version=3.docker-releases" \
-d '{ "updates": [{"type": "web","docker_image": "$(image_id)"}]}'