forked from hellofresh/eks-rolling-update
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (55 loc) · 2.48 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
### --------------------------------------------------------------------------------------------------------------------
### Variables
### (https://www.gnu.org/software/make/manual/html_node/Using-Variables.html#Using-Variables)
### --------------------------------------------------------------------------------------------------------------------
VENV ?= venv
# Other config
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
### --------------------------------------------------------------------------------------------------------------------
### RULES
### (https://www.gnu.org/software/make/manual/html_node/Rule-Introduction.html#Rule-Introduction)
### --------------------------------------------------------------------------------------------------------------------
.PHONY: requirements dist
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " run to run the service"
@echo " test to run unit tests"
@echo " setup to setup the working virtual environment, and to install requirements for development"
@echo " clean to remove the created virtualenv folder"
@echo " code-style to run pep8 on src"
@echo " dist version=1.2.3 to build wheel distribution of version 1.2.3"
@echo " dist-upload version=1.2.3 to build + upload to PyPi wheel distributionof version 1.2.3"
@echo " docker-dist version=1.2.3 to build a Docker image of version 1.2.3"
setup: clean virtualenv requirements test-requirements
run:
python3 $(CURDIR)/eks_rolling_update.py --help
test: code-style test-unit
test-unit:
PYTHONPATH=$(CURDIR) AWS_DEFAULT_REGION=us-east-1 nose2 --with-coverage
code-style:
flake8 --ignore E501 eksrollup/
virtualenv:
virtualenv -p python3 $(CURDIR)/$(VENV)
clean:
rm -rf $(CURDIR)/$(VENV) $(CURDIR)/build $(CURDIR)/dist
requirements:
$(CURDIR)/$(VENV)/bin/pip3 install -r requirements.txt
test-requirements:
$(CURDIR)/$(VENV)/bin/pip3 install -r requirements-tests.txt
before-dist: check_version
mkdir -p build && echo "VERSION = '$(version)'" > build/__version__.py
dist: before-dist
python3 $(CURDIR)/setup.py sdist bdist_wheel
dist-upload: dist
twine upload $(CURDIR)/dist/*
docker-dist: check_version
docker build . --build-arg VERSION=$(version) \
-t eks-rolling-update:$(version) \
-t eks-rolling-update:latest
check_version:
ifndef version
$(error Please specify release `version` argument.`)
endif