forked from vstconsulting/polemarch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
123 lines (103 loc) · 2.84 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
PIP=pip2
PY=python2
LOC_TEST_ENVS = build,py27-django111-coverage,py34-django111-coverage,flake,pylint
ENVS = $(LOC_TEST_ENVS)
TESTS =
NAME = polemarch
USER = $(NAME)
VER = $(shell $(PY) -c 'import polemarch; print(polemarch.__version__)')
PIPARGS = --index-url=http://pipc.vst.lan:8001/simple/ --trusted-host pipc.vst.lan
ARCHIVE = $(NAME)-$(VER).tar.gz
LICENSE = AGPL-3+
define DESCRIPTION
Polemarch is service for orchestration infrastructure by ansible.
Simply WEB gui for orchestration infrastructure by ansible playbooks.
endef
export DESCRIPTION
SUMMARY = Infrastructure Heat Service for orchestration infrastructure by ansible.
VENDOR = VST Consulting <[email protected]>
RELEASE = 0
COMPOSE = docker-compose-testrun.yml
COMPOSE_ARGS = --abort-on-container-exit
COMPLEX_TESTS_COMPOSE = docker-compose-tests.yml
COMPLEX_TESTS_COMPOSE_ARGS = '--abort-on-container-exit --build'
include rpm.mk
include deb.mk
all: compile
docs:
-rm -rf doc/_build
mkdir -p doc/_static
$(PY) setup.py build_sphinx --build-dir doc/_build -W
test:
tox -e $(ENVS) $(TESTS)
flake:
tox -e flake
pylint:
tox -e pylint
build: build-clean
-rm -rf dist
$(PY) setup.py sdist -v
compile: build-clean
-rm -rf dist
find ./polemarch -name "*.c" -print0 | xargs -0 rm -rf
-rm -rf polemarch/doc/*
$(PY) setup.py compile -v
install:
$(PIP) install dist/$(ARCHIVE) django\>=1.8,\<1.12
uninstall:
$(PIP) uninstall $(NAME)
clean: build-clean
find ./polemarch -name "*.c" -print0 | xargs -0 rm -rf
-rm -rf htmlcov
-rm -rf .coverage
-rm -rf dist
-rm -rf build
-rm -rf *.egg-info
build-clean:
find . -name "*.pyc" -print0 | xargs -0 rm -rf
-rm -rf build
-rm -rf *.egg-info
-rm -rf pylint_*
clean_dist:
-rm -rf dist
fclean: clean
find ./polemarch -name "*.c" -print0 | xargs -0 rm -rf
-rm -rf .tox
rpm: compile
echo "$$RPM_SPEC" > polemarch.spec
rm -rf ~/rpmbuild
mkdir -p ~/rpmbuild/SOURCES/
ls -la
cp -vf dist/$(ARCHIVE) ~/rpmbuild/SOURCES
rpmbuild --verbose -bb polemarch.spec
cp -v ~/rpmbuild/RPMS/x86_64/*.rpm dist/
rm polemarch.spec
deb:
rm -rf debian
mkdir debian
# create needed files
echo 9 > debian/compat
echo "$$DEBIAN_CONTROL" > debian/control
echo "$$DEBIAN_COPYRIGHT" > debian/copyright
echo "$$DEBIAN_RULES" > debian/rules
echo "$$DEBIAN_PREINST" > debian/preinst
echo "$$DEBIAN_POSTINST" > debian/postinst
echo "$$DEBIAN_PRERM" > debian/prerm
echo "$$DEBIAN_POSTRM" > debian/postrm
echo "$$DEBIAN_CHANGELOG" > debian/changelog
chmod +x debian/rules
chmod +x debian/preinst
chmod +x debian/postinst
chmod +x debian/prerm
chmod +x debian/postrm
# build
dpkg-buildpackage -uc -us
mv -v ../$(NAME)_$(VER)*.deb dist/
# cleanup
rm -rf debian
compose:
docker-compose -f $(COMPOSE) build
run:
docker-compose -f $(COMPOSE) up $(COMPOSE_ARGS)
complex_tests:
$(MAKE) run COMPOSE=$(COMPLEX_TESTS_COMPOSE) COMPOSE_ARGS=$(COMPLEX_TESTS_COMPOSE_ARGS)