-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
70 lines (53 loc) · 1.42 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
SHELL:=/bin/bash
PY_VERSION := 3.8
BASE := $(shell /bin/pwd)
VENV_DIR := $(BASE)/.venv
PYTHON := $(shell /usr/bin/which python$(PY_VERSION))
VIRTUALENV := $(PYTHON) -m venv
export PYTHONUNBUFFERED := 1
export PATH := var:$(PATH):$(VENV_DIR)/bin
export TABLE_NAME := todo
export AWS_REGION = eu-west-1
FUNCTION_DIR = lib/todo-api
.DEFAULT_GOAL := lint
.PHONY: bootstrap
install:
# Install CDK dependencies
yarn install --frozen-lockfile
# Install Python dependencies
@make install-python
@make install-artillery
build:
# Build CDK
yarn build
# Verify Python
@make lint
# Execute Test
@make test
lint:
sh -c '. .venv/bin/activate; flake8 --tee --output-file=pylint.out --exclude=src/python-libs lib/todo-api'
test:
sh -c '. .venv/bin/activate; py.test -x lib/todo-api/tests'
.PHONY: test
test-integ:
npm run test
install-python: .venv
.venv/bin/pip install -e ./lib/todo-api
ifneq ($(wildcard ./lib/todo-api/test-requirements.txt),)
.venv/bin/pip install -r ./lib/todo-api/test-requirements.txt
endif
install-artillery:
cd stressTest && yarn install
stress:
cd stressTest && yarn test
bootstrap:
@make install
# Bootstrap AWS account
CDK_NEW_BOOTSTRAP=1 yarn cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
deploy:
cdk deploy
.venv:
$(VIRTUALENV) .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install --upgrade setuptools
.venv/bin/pip install --upgrade wheel