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