-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
411 lines (379 loc) · 13.4 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# NOTE:
#
# You need to install these packages on Ubunutu 12.04 to make this work:
#
# sudo apt-get install -y make python-stdeb fakeroot python-all rpm pep8 pylint
#
#
PROJECT_DIR := $(shell pwd)
VERSION := $(shell cat VERSION|tr -d '\n';)
RELEASE := $(shell cat RELEASE|tr -d '\n';)
default: debs rpms source
source: build/f5-oslbaasv1-driver_$(VERSION)_all.src \
build/f5-oslbaasv1-agent_$(VERSION)_all.src \
build/f5-bigip-common_$(VERSION)_all.src
debs: build/f5-oslbaasv1-driver_$(VERSION)_all.deb \
build/f5-oslbaasv1-agent_$(VERSION)_all.deb \
build/f5-bigip-common_$(VERSION)_all.deb
rpms: build/f5-oslbaasv1-driver-$(VERSION).noarch.rpm \
build/f5-oslbaasv1-agent-$(VERSION).noarch.rpm \
build/f5-bigip-common-$(VERSION).noarch.rpm
docker_all: docker_debs docker_el7_rpms docker_el6_rpms
package: docker_all
sudo chmod 777 build
tar czvf build/f5-lbaasv1_$(VERSION)$(RELEASE).tgz release_readme.rst SUPPORT.md build/deb_dist/*.deb build/el7/*.noarch.el7.rpm build/el6/*.noarch.el6.rpm
docker_debs:
(docker build -t deb-pkg-builder ./Docker/debian)
docker run -v $(PROJECT_DIR):/var/bdir deb-pkg-builder /bin/bash /build-debs.sh
docker_el7_rpms:
(docker build -t centos7-pkg-builder ./Docker/redhat/7)
docker run -v $(PROJECT_DIR):/var/bdir centos7-pkg-builder /bin/bash /build-rpms.sh
docker_el6_rpms:
(docker build -t centos6-pkg-builder ./Docker/redhat/6)
docker run -v $(PROJECT_DIR):/var/bdir centos6-pkg-builder /bin/bash /build-rpms.sh
build/f5-oslbaasv1-driver_$(VERSION)_all.src:
(cd driver; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py sdist; \
rm -rf MANIFEST; \
)
mkdir -p build/src
cp driver/dist/f5-oslbaasv1-driver-$(VERSION).tar.gz build/src
build/f5-oslbaasv1-agent_$(VERSION)_all.src:
(cd agent; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py sdist; \
rm -rf MANIFEST; \
)
mkdir -p build/src
cp agent/dist/f5-oslbaasv1-agent-$(VERSION).tar.gz build/src
build/f5-bigip-common_$(VERSION)_all.src:
(cd common; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py sdist; \
rm -rf MANIFEST; \
)
mkdir -p build/src
cp common/dist/f5-bigip-common-$(VERSION).tar.gz build/src
build/f5-bigip-common_$(VERSION)_all.deb:
(cd common; \
rm -rf deb_dist; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py --command-packages=stdeb.command bdist_deb; \
rm -f stdeb.cfg; \
)
mkdir -p build
cp common/deb_dist/f5-bigip-common_$(VERSION)-$(RELEASE)_all.deb build/
build/f5-oslbaasv1-driver_$(VERSION)_all.deb:
(cd driver; \
rm -rf deb_dist; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py --command-packages=stdeb.command bdist_deb; \
rm -f stdeb.cfg; \
)
mkdir -p build
cp driver/deb_dist/f5-oslbaasv1-driver_$(VERSION)-$(RELEASE)_all.deb build/
build/f5-oslbaasv1-agent_$(VERSION)_all.deb:
(cd agent; \
rm -rf deb_dist; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py --command-packages=stdeb.command bdist_deb; \
rm -f stdeb.cfg; \
)
mkdir -p build
cp agent/deb_dist/f5-oslbaasv1-agent_$(VERSION)-$(RELEASE)_all.deb build/
build/f5-bigip-common-$(VERSION).noarch.rpm:
(cd common; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py bdist_rpm; \
rm -f setup.cfg; \
)
mkdir -p build
cp common/dist/f5-bigip-common-$(VERSION)-$(RELEASE).noarch.rpm build
build/f5-oslbaasv1-driver-$(VERSION).noarch.rpm:
(cd driver; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py bdist_rpm; \
rm -f setup.cfg; \
)
mkdir -p build
cp driver/dist/f5-oslbaasv1-driver-$(VERSION)-$(RELEASE).noarch.rpm build
build/f5-oslbaasv1-agent-$(VERSION).noarch.rpm:
(cd agent; \
export PROJECT_DIR=$(PROJECT_DIR); \
export VERSION=$(VERSION); \
export RELEASE=$(RELEASE); \
python setup.py bdist_rpm; \
rm -f setup.cfg; \
)
mkdir -p build
cp agent/dist/f5-oslbaasv1-agent-$(VERSION)-$(RELEASE).noarch.rpm build
clean: clean-debs clean-rpms clean-source
clean-debs:
find . -name "*.pyc" -exec rm -rf {} \;
rm -f driver/MANIFEST
rm -f agent/MANIFEST
rm -f common/MANIFEST
rm -f build/f5-bigip-common_*.deb
(cd common; \
rm -rf deb_dist; \
rm -rf build; \
)
rm -f build/f5-oslbaasv1-agent_*.deb
(cd agent; \
rm -rf deb_dist; \
rm -rf build; \
)
rm -rf build; \
(cd driver; \
rm -rf deb_dist; \
rm -rf build; \
)
clean-rpms:
find . -name "*.pyc" -exec rm -rf {} \;
rm -f common/MANIFEST
rm -f driver/MANIFEST
rm -f agent/MANIFEST
rm -f build/f5-bigip-common-*.rpm
(cd common; \
rm -rf dist; \
rm -rf build; \
)
rm -f build/f5-oslbaasv1-agent-*.rpm
(cd agent; \
rm -rf dist; \
rm -rf build; \
)
rm -f build/f5-oslbaasv1-driver-*.rpm
(cd driver; \
rm -rf dist; \
rm -rf build; \
)
clean-source:
rm -rf build/*.tar.gz
rm -rf common/dist
rm -rf driver/dist
rm -rf driver/driver
rm -rf driver/doc
rm -rf agent/dist
rm -rf agent/agent
rm -rf agent/doc
BDIR := f5/oslbaasv1agent/drivers/bigip
IDIR := f5/bigip/interfaces
PYCTL := f5/bigip/pycontrol
NDIR := /usr/lib/python2.7/dist-packages/neutron
pep8: pep8-driver pep8-agent
pep8-driver:
(cd driver; \
pep8 f5/oslbaasv1driver/__init__.py; \
pep8 f5/oslbaasv1driver/drivers/agent_scheduler.py; \
pep8 f5/oslbaasv1driver/drivers/plugin_driver.py; \
pep8 f5/oslbaasv1driver/drivers/rpc.py; \
pep8 f5/oslbaasv1driver/drivers/constants.py; \
)
pep8-agent:
(cd agent; \
pep8 f5/oslbaasv1agent/__init__.py; \
pep8 f5/oslbaasv1agent/drivers/__init__.py; \
pep8 $(BDIR)/__init__.py; \
pep8 $(BDIR)/agent_api.py; \
pep8 $(BDIR)/agent_manager.py; \
pep8 $(BDIR)/agent.py; \
pep8 $(BDIR)/constants.py; \
pep8 $(BDIR)/exceptions.py; \
pep8 $(BDIR)/fdb_connector_ml2.py; \
pep8 $(BDIR)/fdb_connector.py; \
pep8 $(BDIR)/icontrol_driver.py; \
pep8 $(BDIR)/l2.py; \
pep8 $(BDIR)/l3_binding.py; \
pep8 $(BDIR)/lbaas.py; \
pep8 $(BDIR)/lbaas_driver.py; \
pep8 $(BDIR)/lbaas_iapp.py; \
pep8 $(BDIR)/lbaas_bigiq.py; \
pep8 $(BDIR)/lbaas_bigip.py; \
pep8 $(BDIR)/network_direct.py; \
pep8 $(BDIR)/rpc.py; \
pep8 $(BDIR)/selfips.py; \
pep8 $(BDIR)/snats.py; \
pep8 $(BDIR)/pools.py; \
pep8 $(BDIR)/tenants.py; \
pep8 $(BDIR)/vcmp.py; \
pep8 $(BDIR)/vips.py; \
pep8 $(BDIR)/utils.py; \
)
pep8-common:
(cd common; \
pep8 f5/__init__.py; \
pep8 f5/bigip/__init__.py; \
pep8 f5/bigip/bigip.py; \
pep8 f5/bigip/exceptions.py; \
pep8 $(IDIR)/__init__.py; \
pep8 $(IDIR)/arp.py; \
pep8 $(IDIR)/cluster.py; \
pep8 $(IDIR)/device.py; \
pep8 $(IDIR)/iapp.py; \
pep8 $(IDIR)/l2gre.py; \
pep8 $(IDIR)/monitor.py; \
pep8 $(IDIR)/nat.py; \
pep8 $(IDIR)/pool.py; \
pep8 $(IDIR)/route.py; \
pep8 $(IDIR)/rule.py; \
pep8 $(IDIR)/selfip.py; \
pep8 $(IDIR)/snat.py; \
pep8 $(IDIR)/system.py; \
pep8 $(IDIR)/virtual_server.py; \
pep8 $(IDIR)/vlan.py; \
pep8 $(IDIR)/vxlan.py; \
pep8 $(PYCTL)/__init__.py; \
pep8 $(PYCTL)/pycontrol.py; \
pep8 f5/bigiq/__init__.py; \
pep8 f5/bigiq/bigiq.py; \
pep8 f5/common/__init__.py; \
pep8 f5/common/constants.py; \
pep8 f5/common/logger.py; \
pep8 $(IDIR)/constants.py; \
)
PYHOOK := 'import sys;sys.path.insert(1,".")'
PYLINT := pylint --additional-builtins=_ --init-hook=$(PYHOOK)
pylint: pylint-agent pylint-driver
pylint-agent:
(cd agent; \
mkdir neutron; \
touch neutron/__init__.py; \
mkdir neutron/services; \
touch neutron/services/__init__.py; \
mkdir neutron/services/loadbalancer; \
touch neutron/services/loadbalancer/__init__.py; \
mkdir neutron/services/loadbalancer/drivers; \
touch neutron/services/loadbalancer/drivers/__init__.py; \
ln -s $(NDIR)/common neutron/common; \
ln -s $(NDIR)/openstack neutron/openstack; \
ln -s $(NDIR)/plugins neutron/plugins; \
ln -s $(NDIR)/services/constants neutron/services/constants; \
ln -s $(NDIR)/services/loadbalancer/constants.py \
neutron/services/loadbalancer/constants.py; \
ln -s ../../common/f5/bigip f5/bigip; \
$(PYLINT) f5/bigiq/bigiq.py; \
$(PYLINT) $(BDIR)/fdb_connector.py; \
$(PYLINT) $(BDIR)/fdb_connector_ml2.py; \
$(PYLINT) $(BDIR)/lbaas_driver.py; \
$(PYLINT) $(BDIR)/icontrol_driver.py; \
$(PYLINT) $(BDIR)/lbaas.py; \
$(PYLINT) $(BDIR)/lbaas_iapp.py; \
$(PYLINT) $(BDIR)/lbaas_bigiq.py; \
$(PYLINT) $(BDIR)/lbaas_bigip.py; \
$(PYLINT) $(BDIR)/l2.py; \
$(PYLINT) $(BDIR)/l3_binding.py; \
$(PYLINT) $(BDIR)/network_direct.py; \
$(PYLINT) $(BDIR)/pools.py; \
$(PYLINT) $(BDIR)/selfips.py; \
$(PYLINT) $(BDIR)/snats.py; \
$(PYLINT) $(BDIR)/tenants.py; \
$(PYLINT) $(BDIR)/vcmp.py; \
$(PYLINT) $(BDIR)/vips.py; \
$(PYLINT) $(BDIR)/utils.py; \
$(PYLINT) $(IDIR)/__init__.py; \
$(PYLINT) $(IDIR)/arp.py; \
$(PYLINT) $(IDIR)/iapp.py; \
$(PYLINT) $(IDIR)/l2gre.py; \
$(PYLINT) $(IDIR)/route.py; \
$(PYLINT) $(IDIR)/system.py; \
$(PYLINT) $(IDIR)/virtual_server.py; \
$(PYLINT) $(IDIR)/vxlan.py; \
rm -v f5/bigip; \
rm -v neutron/plugins; \
rm -v neutron/openstack; \
rm -v neutron/common; \
rm -v neutron/services/constants; \
rm -v neutron/services/loadbalancer/constants.py; \
rm -v neutron/services/loadbalancer/drivers/__init__.py; \
rm -v neutron/services/loadbalancer/__init__.py; \
rm -v neutron/services/__init__.py; \
rm -v neutron/__init__.py; \
rm -rf ./neutron; \
)
pylint-driver:
(cd driver; \
mkdir neutron; \
touch neutron/__init__.py; \
mkdir neutron/services; \
touch neutron/services/__init__.py; \
mkdir neutron/services/loadbalancer; \
touch neutron/services/loadbalancer/__init__.py; \
mkdir neutron/services/loadbalancer/drivers; \
touch neutron/services/loadbalancer/drivers/__init__.py; \
ln -s $(NDIR)/api neutron/api; \
ln -s $(NDIR)/common neutron/common; \
ln -s $(NDIR)/context.py neutron/context.py; \
ln -s $(NDIR)/db neutron/db; \
ln -s $(NDIR)/extensions neutron/extensions; \
ln -s $(NDIR)/openstack neutron/openstack; \
ln -s $(NDIR)/plugins neutron/plugins; \
ln -s $(NDIR)/services/constants neutron/services/constants; \
ln -s $(NDIR)/services/loadbalancer/constants.py \
neutron/services/loadbalancer/constants.py; \
$(PYLINT) f5/oslbaasv1driver/drivers/plugin_driver.py; \
$(PYLINT) f5/oslbaasv1driver/drivers/agent_scheduler.py; \
$(PYLINT) f5/oslbaasv1driver/drivers/rpc.py; \
$(PYLINT) f5/oslbaasv1driver/drivers/log/plugin_driver.py; \
rm -v neutron/api; \
rm -v neutron/plugins; \
rm -v neutron/openstack; \
rm -v neutron/common; \
rm -v neutron/context.py; \
rm -v neutron/db; \
rm -v neutron/extensions; \
rm -v neutron/services/constants; \
rm -v neutron/services/loadbalancer/constants.py; \
rm -v neutron/services/loadbalancer/drivers/__init__.py; \
rm -v neutron/services/loadbalancer/__init__.py; \
rm -v neutron/services/__init__.py; \
rm -v neutron/__init__.py; \
rm -rf ./neutron; \
)
test-agent:
(cd agent; \
> neutron/__init__.py; \
> neutron/services/__init__.py; \
> neutron/services/loadbalancer/__init__.py; \
> neutron/services/loadbalancer/drivers/__init__.py; \
ln -s $(NDIR)/common neutron/common; \
ln -s $(NDIR)/openstack neutron/openstack; \
ln -s $(NDIR)/plugins neutron/plugins; \
ln -s $(NDIR)/services/constants neutron/services/constants; \
ln -s $(NDIR)/services/loadbalancer/constants.py \
neutron/services/loadbalancer/constants.py; \
cp ../test/test.py .; \
python test.py; \
rm test.py; \
rm -vf neutron/plugins; \
rm -vf neutron/openstack; \
rm -vf neutron/common; \
rm -vf neutron/services/constants; \
rm -vf neutron/services/loadbalancer/constants.py; \
rm -vf neutron/services/loadbalancer/constants.pyc; \
rm -vf neutron/services/loadbalancer/drivers/__init__.py; \
rm -vf neutron/services/loadbalancer/drivers/__init__.pyc; \
rm -vf neutron/services/loadbalancer/__init__.py; \
rm -vf neutron/services/loadbalancer/__init__.pyc; \
rm -vf neutron/services/__init__.py; \
rm -vf neutron/services/__init__.pyc; \
rm -vf neutron/__init__.py; \
rm -vf neutron/__init__.pyc; \
)