1
by Antoni Segura Puimedon
Initial commit |
1 |
#!/usr/bin/make
|
2 |
CODE=hooks |
|
3 |
PYTHON := /usr/bin/env python |
|
4 |
TESTS=unit_tests/ |
|
5 |
||
6 |
.venv2: |
|
7 |
virtualenv .venv2 --python=python2 --system-site-packages
|
|
8 |
.venv2/bin/pip install -U pip |
|
9 |
.venv2/bin/pip install -I -r unit_test_requirements.txt |
|
10 |
||
11 |
.venv3: |
|
12 |
virtualenv .venv3 --python=python3 --system-site-packages
|
|
13 |
.venv3/bin/pip install -U pip |
|
14 |
.venv3/bin/pip install -U distribute |
|
15 |
.venv3/bin/pip install -I -r unit_test_requirements.txt |
|
16 |
||
17 |
lint: .venv2 .venv3 |
|
18 |
@.venv2/bin/flake8 --ignore=E501,H803 \ |
|
19 |
--exclude charmhelpers,test.py \
|
|
20 |
$(CODE) && echo Py2 OK |
|
21 |
@.venv3/bin/flake8 --ignore=E501,H803 \ |
|
22 |
$(CODE) && echo Py3 OK |
|
23 |
||
24 |
test2: .venv2 |
|
25 |
@echo Starting Py2 tests... |
|
26 |
PYTHONPATH=$(CODE) .venv2/bin/nosetests -s --nologcapture $(TESTS) |
|
27 |
||
28 |
test3: .venv3 |
|
29 |
@echo Starting Py3 tests... |
|
30 |
PYTHONPATH=$(CODE) .venv3/bin/nosetests -s --nologcapture $(TESTS) |
|
31 |
||
32 |
test: lint test2 test3 |
|
33 |
||
34 |
bin/charm_helpers_sync.py: |
|
35 |
@mkdir -p bin |
|
36 |
@bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
|
|
37 |
> bin/charm_helpers_sync.py |
|
38 |
||
39 |
bin/midonet_helpers_sync.py: |
|
40 |
@mkdir -p bin |
|
41 |
@bzr cat \
|
|
42 |
lp:midonet-helpers/tools/midonet_helpers_sync/midonet_helpers_sync.py \
|
|
43 |
> bin/midonet_helpers_sync.py |
|
44 |
||
45 |
templates/repo.yaml: |
|
46 |
@bzr cat lp:midonet-helpers/templates/repo.yaml > templates/repo.yaml |
|
47 |
||
48 |
sync: bin/charm_helpers_sync.py bin/midonet_helpers_sync.py templates/repo.yaml |
|
49 |
@$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml |
|
50 |
@$(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-tests.yaml |
|
51 |
@$(PYTHON) bin/midonet_helpers_sync.py -c midonet-helpers-hooks.yaml |
|
52 |
@$(PYTHON) bin/midonet_helpers_sync.py -c midonet-helpers-tests.yaml |
|
53 |
||
54 |
publish: lint test |
|
55 |
bzr push lp:~celebdor/charms/trusty/neutron-agents-midonet/trunk |