-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (75 loc) · 3.64 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.PHONY: help Makefile docs tests
# ------------------------------------------------------------------------------------ #
# Initialization #
# #
# init #
# init-stockfish-linux #
# init-stockfish-macosx #
# init-serverless #
# init-linux #
# init-macosx #
# ------------------------------------------------------------------------------------ #
init:
@pip install poetry
@poetry install
@pre-commit install
@pre-commit install -t pre-push
@pre-commit install -t pre-merge-commit
@npm install -g serverless
@npm install serverless-python-requirements
@npm install netlify-cli -g
init-stockfish-linux:
@wget https://stockfishchess.org/files/stockfish_12_linux_x64_bmi2.zip
@unzip stockfish_12_linux_x64_bmi2.zip
@mkdir -p bin
@mv stockfish_20090216_x64_bmi2 bin/stockfish
@chmod +x bin/stockfish
@rm stockfish_12_linux_x64_bmi2.zip
init-stockfish-macosx: ;
init-linux:
@$(MAKE) init-stockfish-linux
@$(MAKE) init
init-macosx:
@$(MAKE) init-stockfish-macosx
@$(MAKE) init
# ------------------------------------------------------------------------------------ #
# Dependencies #
# #
# deps api pip #
# ------------------------------------------------------------------------------------ #
deps-api-pip:
@dephell deps convert --envs main --to-format=pip --to-path=chess_blunders/app/api/requirements.txt
@echo '../../../' >> chess_blunders/app/api/requirements.txt
# ------------------------------------------------------------------------------------ #
# CI/CD #
# #
# tests #
# deploy-api-prod #
# deploy-api-dev #
# build-web #
# deploy-web-prod #
# deploy-web-dev #
# ci-tests #
# ci-integration #
# ci-deployment #
# ------------------------------------------------------------------------------------ #
tests:
@python -m pytest --cov=chess_blunders --cov-branch --verbose
deploy-api-prod:
@cd chess_blunders/app/api && sls deploy --stage prod
deploy-api-dev:
@cd chess_blunders/app/api && sls deploy --stage dev
build-web:
@npm --prefix chess_blunders/app/web run build
deploy-web-prod:
@$(MAKE) build-web
@netlify deploy --prod
deploy-web-dev:
@$(MAKE) build-web
@netlify deploy
ci-tests:
@$(MAKE) tests
ci-integration:
@pre-commit run --all-files
@$(MAKE) ci-tests
ci-deployment: ;