-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
130 lines (86 loc) · 3 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/make -f
DOCKER_COMPOSE_CI = docker-compose -f docker-compose.yml -f docker-compose.ci.override.yml
DOCKER_COMPOSE_DEV = docker-compose -f docker-compose.yml -f docker-compose.dev.override.yml
DOCKER_COMPOSE = $(DOCKER_COMPOSE_DEV)
VENV = venv
PIP = $(VENV)/bin/pip
PYTHON = $(VENV)/bin/python
PYTEST_WATCH_MODULES = tests/unit_test
venv-clean:
@if [ -d "$(VENV)" ]; then \
rm -rf "$(VENV)"; \
fi
venv-create:
python3 -m venv $(VENV)
venv-activate:
chmod +x venv/bin/activate
bash -c "venv/bin/activate"
dev-install:
$(PIP) install --disable-pip-version-check -r requirements.build.txt
SLUGIFY_USES_TEXT_UNIDECODE=yes \
$(PIP) install --disable-pip-version-check -r requirements.txt
$(PIP) install --disable-pip-version-check -r requirements.dev.txt
$(PIP) install --disable-pip-version-check -e . --no-deps
dev-venv: venv-create dev-install
dev-flake8:
$(PYTHON) -m flake8 ejp_xml_pipeline tests
dev-pylint:
$(PYTHON) -m pylint ejp_xml_pipeline tests
dev-mypy:
$(PYTHON) -m mypy ejp_xml_pipeline tests
dev-lint: dev-flake8 dev-pylint dev-mypy
dev-unittest:
$(PYTHON) -m pytest -p no:cacheprovider $(ARGS) tests/unit_test
dev-watch:
$(PYTHON) -m pytest_watch -- -p no:cacheprovider $(ARGS) $(PYTEST_WATCH_MODULES)
dev-test: dev-lint dev-unittest
dev-run-ejp-xml-pipeline:
EJP_XML_CONFIG_FILE_PATH=sample_data_config/ejp-xml-data-pipeline.config.yaml \
$(PYTHON) -m ejp_xml_pipeline.cli
dev-clear-state:
aws s3 rm s3://ci-elife-data-pipeline/airflow-config/ejp-xml/ejp-xml-processing-state-test.json
build:
$(DOCKER_COMPOSE) build data-hub-pipelines
build-dev:
$(DOCKER_COMPOSE) build data-hub-pipelines-dev
flake8:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev \
python -m flake8 ejp_xml_pipeline tests
pylint:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev \
python -m pylint ejp_xml_pipeline tests
mypy:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev \
python -m mypy ejp_xml_pipeline tests
lint: flake8 pylint mypy
unittest:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev \
python -m pytest -p no:cacheprovider $(ARGS) tests/unit_test
test: lint unittest
watch:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev \
python -m pytest_watch -- -p no:cacheprovider $(ARGS) $(PYTEST_WATCH_MODULES)
test-exclude-e2e: build-dev
$(DOCKER_COMPOSE) run --rm data-hub-pipelines-dev ./run_test.sh
clean:
$(DOCKER_COMPOSE) down -v
data-hub-pipelines-run-ejp-xml-pipeline:
$(DOCKER_COMPOSE) run --rm data-hub-pipelines \
python -m ejp_xml_pipeline.cli
end2end-test:
$(DOCKER_COMPOSE) run --rm test-client
ci-build-main-image:
$(MAKE) DOCKER_COMPOSE="$(DOCKER_COMPOSE_CI)" \
build
ci-test-exclude-e2e: build-dev
$(MAKE) DOCKER_COMPOSE="$(DOCKER_COMPOSE_CI)" \
test-exclude-e2e
ci-build-and-end2end-test:
$(MAKE) DOCKER_COMPOSE="$(DOCKER_COMPOSE_CI)" \
build-dev \
end2end-test
ci-clean:
$(DOCKER_COMPOSE_CI) down -v
retag-push-image:
docker tag $(EXISTING_IMAGE_REPO):$(EXISTING_IMAGE_TAG) $(IMAGE_REPO):$(IMAGE_TAG)
docker push $(IMAGE_REPO):$(IMAGE_TAG)