-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (36 loc) · 1.13 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
SHELL = /bin/bash
.SHELLFLAGS = -euo pipefail -c
REGISTRY := "$${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com"
REPOSITORY := $${REPO}
TAG := "$${BITBUCKET_COMMIT}"
LATEST_TAG := "latest"
APP_DIR := app
dev-clean:
@{\
find $(APP_DIR) -type d -name "__pycache__" | xargs -i rm -rf {};\
find $(APP_DIR) -type d -name ".pytest_cache" | xargs -i rm -rf {};\
find $(APP_DIR) -type f -name ".coverage" | xargs -i rm -rf {};\
}
dev-lint: dev-clean
@{\
blue --safe -l 120 $(APP_DIR) ;\
flake8 $(APP_DIR) --extend-exclude=dist,build,.venv --show-source --statistics --max-line-length 120 ;\
}
dev-run:
@{\
cd $(APP_DIR);\
uvicorn main:app --host 127.0.0.1 --port 8000 --workers 1;\
}
infra-stop:
@{\
docker-compose -f docker-compose.yml stop ;\
}
infra-start: infra-stop
@{\
docker-compose -f docker-compose.yml up --remove-orphans ;\
}
docker-build:
docker build -t $(REGISTRY)/$(REPOSITORY):$(TAG) .
docker push $(REGISTRY)/$(REPOSITORY):$(TAG)
docker tag $(REGISTRY)/$(REPOSITORY):$(TAG) $(REGISTRY)/$(REPOSITORY):latest
docker push $(REGISTRY)/$(REPOSITORY):latest