-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
69 lines (46 loc) · 1.36 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Makefile for Sample Book API
# Can be used from github workflow and locally
include .env
default: install test lint
test: lint test.all
test.cov: test.coverage
test.all:
@pytest tests
test.coverage:
@coverage run -m pytest -vv tests && coverage report -m --omit="*/test*,config/*.conf" --fail-under=85
install:
@poetry install
server.start:
@poetry run python3 main.py
export.schema:
@strawberry export-schema src.graphql_api:schema > ./schema.graphql
lint:
@poetry run pylint app tests
format.check:
@black . --check
format.fix:
@black .
registry.login:
@aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT).dkr.ecr.$(AWS_REGION).amazonaws.com
registry.deploy:
@docker push $(AWS_ACCOUNT).dkr.ecr.$(AWS_REGION).amazonaws.com/book-api:latest
image.build:
./build-image.sh
image.tag:
@docker tag bookapi:latest $(AWS_ACCOUNT).dkr.ecr.$(AWS_REGION).amazonaws.com/book-api
image.deploy: registry.login image.tag registry.deploy
run.container:
@docker run -d --name bookapi -p 8000:8000 bookapi
stop.container:
@docker stop bookapi && docker rm bookapi
version.bump.patch:
@poetry version patch
version.bump.minor:
@poetry version minor
version.bump.major:
@poetry version major
cdk.synth:
@cdk synth --require-approval never
cdk.deploy:
@cdk deploy
deployment: export.schema cdk.synth cdk.deploy