-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (43 loc) · 1.32 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
TARGET ?= ./
APP_NAME = hospital_app
IMAGE_NAME ?= sshishov/$(APP_NAME)
IMAGE_VERSION ?= latest
GIT_REF = $(shell git rev-parse HEAD)
TEST_ARGS ?= --cov=$(TARGET) --verbose --cov-report=xml --cov-report=term --junitxml=xmlrunner/unittest.xml
.PHONY: docker
docker-local:
tar -pczf /tmp/archive.tar.gz --exclude=".git" --exclude="*.pyc" --exclude="local_settings.py" .
mv /tmp/archive.tar.gz docker/archive.tar.gz
$(MAKE) docker-common
docker-git:
git archive --format tar.gz --output docker/archive.tar.gz $(GIT_REF)
$(MAKE) docker-common
docker-common:
docker build -t $(IMAGE_NAME):$(IMAGE_VERSION) -f docker/Dockerfile .
$(MAKE) clean-docker
docker: docker-git
docker-push:
docker push $(IMAGE_NAME):$(IMAGE_VERSION)
clean-docker:
-rm -rf docker/archive.tar.gz
clean-pyc:
find . -name "*.pyc" -exec rm -f {} \;
clean: clean-pyc
lint:
flake8 --statistics --count $(TARGET)
pylint core content_first_service *.py
test-unit:
TEST_ARGS="$(TEST_ARGS) --cov-fail-under=10 -m unit" $(MAKE) lint-test
test-integration:
TEST_ARGS="$(TEST_ARGS) -m integration" $(MAKE) lint-test
lint-test: lint test
test: clean
mkdir -p xmlrunner
coverage erase
pytest $(TEST_ARGS) $(TARGET)
translate:
python manage.py makemessages --no-location --no-obsolete --no-wrap --locale ru
release:
$(MAKE) docker-git
$(MAKE) docker-push
eb deploy