blob: b5f6ac5941ae038846c442a5ba145f8af416b829 [file] [log] [blame]
garciadeblas9453a8a2017-03-09 16:21:24 +01001SHELL := /bin/bash
garciadeblase5ef5172017-04-20 14:46:29 +02002all: package install
garciadeblas9453a8a2017-03-09 16:21:24 +01003
4prepare:
Gennadiy Dubina311ea742017-04-03 20:46:16 +03005 pip install setuptools
garciadeblas2c290ca2017-04-06 03:12:51 +02006 mkdir -p build/
garciadeblas4b6216b2017-04-20 16:41:52 +02007 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
garciadeblas2c290ca2017-04-06 03:12:51 +020011 cp MANIFEST.in build/
garciadeblas06e6c392017-03-28 15:42:20 +020012 cp requirements.txt build/
13 cp README.rst build/
garciadeblas2c290ca2017-04-06 03:12:51 +020014 cp setup.py build/
garciadeblase5ef5172017-04-20 14:46:29 +020015 cp stdeb.cfg build/
garciadeblas2c290ca2017-04-06 03:12:51 +020016 cp -r osm_ro build/
17 cp openmano build/
garciadeblascf1826b2017-04-18 10:03:17 +020018 cp openmanod build/
garciadeblas2c290ca2017-04-06 03:12:51 +020019 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
garciadeblas9453a8a2017-03-09 16:21:24 +010024
garciadeblas06e6c392017-03-28 15:42:20 +020025connectors: prepare
26 # python-novaclient is required for that
garciadeblas2c290ca2017-04-06 03:12:51 +020027 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
garciadeblas9453a8a2017-03-09 16:21:24 +010031
garciadeblas2c290ca2017-04-06 03:12:51 +020032build: connectors prepare
33 python -m py_compile build/osm_ro/*.py
garciadeblas9453a8a2017-03-09 16:21:24 +010034
garciadeblascf1826b2017-04-18 10:03:17 +020035pip: prepare
36 cd build && ./setup.py sdist
garciadeblas06e6c392017-03-28 15:42:20 +020037
garciadeblase5ef5172017-04-20 14:46:29 +020038package: prepare
garciadeblas4b6216b2017-04-20 16:41:52 +020039 #apt-get install -y python-stdeb
garciadeblase5ef5172017-04-20 14:46:29 +020040 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
garciadeblas06e6c392017-03-28 15:42:20 +020043
garciadeblascf1826b2017-04-18 10:03:17 +020044snap:
garciadeblas06e6c392017-03-28 15:42:20 +020045 echo "Nothing to be done yet"
46
garciadeblascf1826b2017-04-18 10:03:17 +020047install:
garciadeblase5ef5172017-04-20 14:46:29 +020048 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
garciadeblascf1826b2017-04-18 10:03:17 +020052
53develop: prepare
garciadeblase5ef5172017-04-20 14:46:29 +020054 #pip install -r requirements.txt
garciadeblascf1826b2017-04-18 10:03:17 +020055 cd build && ./setup.py develop
56
garciadeblas06e6c392017-03-28 15:42:20 +020057test:
58 ./test/basictest.sh --force --insert-bashrc --install-openvim --init-openvim
59
Gennadiy Dubina311ea742017-04-03 20:46:16 +030060build-docker-from-source:
61 docker build -t osm/openmano -f docker/Dockerfile-local .
62
63run-docker:
64 docker-compose -f docker/openmano-compose.yml up
65
66stop-docker:
67 docker-compose -f docker/openmano-compose.yml down
68
garciadeblas9453a8a2017-03-09 16:21:24 +010069clean:
70 rm -rf build
garciadeblas4b6216b2017-04-20 16:41:52 +020071 find osm_ro -name '*.pyc' -delete
72 find osm_ro -name '*.pyo' -delete
garciadeblas9453a8a2017-03-09 16:21:24 +010073