| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 1 | SHELL := /bin/bash |
| garciadeblas | e5ef517 | 2017-04-20 14:46:29 +0200 | [diff] [blame] | 2 | all: package install |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 3 | |
| garciadeblas | d40e551 | 2017-04-21 15:09:26 +0200 | [diff] [blame^] | 4 | clean_deb: |
| 5 | rm -rf .build |
| 6 | |
| 7 | clean: |
| 8 | rm -rf build |
| 9 | find osm_ro -name '*.pyc' -delete |
| 10 | find osm_ro -name '*.pyo' -delete |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 11 | prepare: |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 12 | pip install setuptools |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 13 | mkdir -p build/ |
| garciadeblas | 4b6216b | 2017-04-20 16:41:52 +0200 | [diff] [blame] | 14 | VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \ |
| 15 | VER2=$(shell git describe | cut -d- -f2); \ |
| 16 | VER3=$(shell git describe | cut -d- -f3); \ |
| 17 | echo "$$VER1.dev$$VER2+$$VER3" > build/RO_VERSION |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 18 | cp MANIFEST.in build/ |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 19 | cp requirements.txt build/ |
| 20 | cp README.rst build/ |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 21 | cp setup.py build/ |
| garciadeblas | e5ef517 | 2017-04-20 14:46:29 +0200 | [diff] [blame] | 22 | cp stdeb.cfg build/ |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 23 | cp -r osm_ro build/ |
| 24 | cp openmano build/ |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 25 | cp openmanod build/ |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 26 | cp -r vnfs build/osm_ro |
| 27 | cp -r scenarios build/osm_ro |
| 28 | cp -r instance-scenarios build/osm_ro |
| 29 | cp -r scripts build/osm_ro |
| 30 | cp -r database_utils build/osm_ro |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 31 | |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 32 | connectors: prepare |
| 33 | # python-novaclient is required for that |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 34 | rm -f build/osm_ro/openmanolinkervimconn.py |
| 35 | cd build/osm_ro; for i in `ls vimconn_*.py |sed "s/\.py//"` ; do echo "import $$i" >> openmanolinkervimconn.py; done |
| 36 | python build/osm_ro/openmanolinkervimconn.py |
| 37 | rm -f build/osm_ro/openmanolinkervimconn.py |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 38 | |
| garciadeblas | d40e551 | 2017-04-21 15:09:26 +0200 | [diff] [blame^] | 39 | build: clean connectors prepare |
| garciadeblas | 2c290ca | 2017-04-06 03:12:51 +0200 | [diff] [blame] | 40 | python -m py_compile build/osm_ro/*.py |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 41 | |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 42 | pip: prepare |
| 43 | cd build && ./setup.py sdist |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 44 | |
| garciadeblas | d40e551 | 2017-04-21 15:09:26 +0200 | [diff] [blame^] | 45 | package: clean clean_deb prepare |
| garciadeblas | 4b6216b | 2017-04-20 16:41:52 +0200 | [diff] [blame] | 46 | #apt-get install -y python-stdeb |
| garciadeblas | e5ef517 | 2017-04-20 14:46:29 +0200 | [diff] [blame] | 47 | cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True |
| 48 | cd build && cp osm_ro/scripts/python-osm-ro.postinst deb_dist/osm-ro*/debian/ |
| 49 | cd build/deb_dist/osm-ro* && dpkg-buildpackage -rfakeroot -uc -us |
| garciadeblas | d40e551 | 2017-04-21 15:09:26 +0200 | [diff] [blame^] | 50 | mkdir -p .build |
| 51 | cp build/deb_dist/python-*.deb ./build/ |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 52 | |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 53 | snap: |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 54 | echo "Nothing to be done yet" |
| 55 | |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 56 | install: |
| garciadeblas | e5ef517 | 2017-04-20 14:46:29 +0200 | [diff] [blame] | 57 | DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| 58 | DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip && \ |
| 59 | pip install --upgrade pip && \ |
| garciadeblas | d40e551 | 2017-04-21 15:09:26 +0200 | [diff] [blame^] | 60 | dpkg -i .build/*.deb |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 61 | |
| 62 | develop: prepare |
| garciadeblas | e5ef517 | 2017-04-20 14:46:29 +0200 | [diff] [blame] | 63 | #pip install -r requirements.txt |
| garciadeblas | cf1826b | 2017-04-18 10:03:17 +0200 | [diff] [blame] | 64 | cd build && ./setup.py develop |
| 65 | |
| garciadeblas | 06e6c39 | 2017-03-28 15:42:20 +0200 | [diff] [blame] | 66 | test: |
| 67 | ./test/basictest.sh --force --insert-bashrc --install-openvim --init-openvim |
| 68 | |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 69 | build-docker-from-source: |
| 70 | docker build -t osm/openmano -f docker/Dockerfile-local . |
| 71 | |
| 72 | run-docker: |
| 73 | docker-compose -f docker/openmano-compose.yml up |
| 74 | |
| 75 | stop-docker: |
| 76 | docker-compose -f docker/openmano-compose.yml down |
| 77 | |
| garciadeblas | 9453a8a | 2017-03-09 16:21:24 +0100 | [diff] [blame] | 78 | |