-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (41 loc) · 1.85 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
# docker hub user
DOCKER_HUB_USERNAME=thiagojacinto
DOCKER_HUB_REPOSITORY=test-glossary-api
# shell colors
COLOUR_GREEN=\033[0;32m
COLOUR_RED=\033[0;31m
COLOUR_BLUE=\033[0;34m
COLOUR_END=\033[0m
# setting source code directory
APP_SOURCE_CODE_DIR='./testglossary'
install: # install project dependencies from requirements.txt file
@echo "$(COLOUR_RED)Start installing process ...$(COLOUR_END)"
pip install -r ./requirements.txt
test: # execute all tests
@echo "$(COLOUR_GREEN)Executing tests ...$(COLOUR_END)"
python -m pytest --verbose
lint: # use linter
@echo "$(COLOUR_GREEN)Running lint process ...$(COLOUR_END)"
python -m black $(APP_SOURCE_CODE_DIR) ; \
python -m isort --profile black $(APP_SOURCE_CODE_DIR) ; \
python -m autopep8 --in-place --recursive --verbose $(APP_SOURCE_CODE_DIR)
run: # starts uvicorn server with auto reload @ port 8880
@echo "$(COLOUR_GREEN)Starting server ...$(COLOUR_END)"
uvicorn testglossary.main:app --reload --port=8880
go-prod: # Run in Production environment. Starts uvicorn server with auto reload
@echo "$(COLOUR_GREEN)Starting server ...$(COLOUR_END)"
PRODUCTION_READY=true uvicorn testglossary.main:app --reload --log-config=log_conf.yaml
gh-deploy: # builds and deploy MkDocs documentation style to GitHub Pages
mkdocs gh-deploy --verbose --strict --remote-branch="support/gh-pages"
docker-build: GET_NOW := $(shell date +%s)
docker-build: # builds a new container image
@echo "$(COLOUR_RED)Building a Docker image ...$(COLOUR_END)"
TAG_NAME="$(DOCKER_HUB_USERNAME)/$(DOCKER_HUB_REPOSITORY):$(GET_NOW)" ; \
docker build -t $${TAG_NAME} .
#: #########################################
#: #### Help - Makefile for TestGlossary API
#: #########################################
help: # list all Makefile commands
@echo "$(COLOUR_BLUE)These are all the avalaible commands ...$(COLOUR_END)"
@echo ""
@grep ': #' Makefile