-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
38 lines (27 loc) · 925 Bytes
/
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
COMMIT_HASH = $(shell git log -n 1 --pretty=format:"%H")
clean:
rm -rf ./env ./dist ./build ./artifacts ./dbsnap*.egg-info
### Python2 ###
test: clean virtualenv
. env/bin/activate && python setup.py pytest
virtualenv:
virtualenv ./env
build: clean virtualenv
. env/bin/activate && python setup.py install
build-lambda: build
mkdir ./artifacts
cp aws_lambda.py ./dist
cp -rf env/lib/python*/site-packages/* ./dist
cd ./dist && zip -r "../artifacts/lambda-dbsnap-$(COMMIT_HASH).zip" .
### Python3 ###
test3: clean venv
. env/bin/activate && python setup.py pytest
venv:
python3 -m venv env && env/bin/pip install setuptools --upgrade
build3: clean venv
. env/bin/activate && python setup.py install
build-lambda3: build3
mkdir ./artifacts
cp aws_lambda.py ./dist
cp -rf env/lib/python*/site-packages/* ./dist
cd ./dist && zip -r "../artifacts/lambda-dbsnap-$(COMMIT_HASH).zip" .