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