-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 1.58 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
HUMILIS := .env/bin/humilis
PIP := .env/bin/pip
PYTHON := .env/bin/python
TOX := .env/bin/tox
STAGE := DEV
HUMILIS_ENV := tests/integration/humilis-kinesis-processor
# create virtual environment
.env:
virtualenv .env -p python3
# install AWS Lambda like virtualenv
.lambda:
virtualenv .lambda -p python3.6
.lambda/bin/pip install -r requirements-lambda.txt
# install dev dependencies, create layers directory
develop: .env
$(PIP) install -r requirements-test.txt -r requirements-dev.txt
# run unit tests
test: .env
$(PIP) install tox
$(TOX) -e unit
# run integration tests (require deployment)
testi: .env
$(PIP) install tox
$(TOX) -e integration
# remove .tox and .env dirs
clean:
rm -rf .env .tox .lambda tests/*.pyc tests/__pycache__ \
humilis_kinesis_processor/*.pyc humilis_kinesis_processor/__pycache__
# deploy secrets to the environment secrets vault
secrets:
$(PYTHON) scripts/deploy-secrets.py $(HUMILIS_ENV).yaml.j2 $(STAGE)
# create CF stacks
create-cf: develop
$(HUMILIS) create \
--stage $(STAGE) \
--output $(HUMILIS_ENV)-$(STAGE).outputs.yaml $(HUMILIS_ENV).yaml.j2
# deploy the test environment
create: create-cf secrets
# update CF stacks
update-cf: develop
$(HUMILIS) update \
--stage $(STAGE) \
--output $(HUMILIS_ENV)-$(STAGE).outputs.yaml $(HUMILIS_ENV).yaml.j2
# update the test deployment
update: update-cf secrets
# delete the test deployment
delete: develop
$(PYTHON) ./scripts/empty-bucket.py $(HUMILIS_ENV)-$(STAGE).outputs.yaml
$(HUMILIS) delete --stage $(STAGE) $(HUMILIS_ENV).yaml.j2
# upload to Pypi
pypi: develop
$(PYTHON) setup.py sdist upload