blob: 71425c6cf3c35f3da449f216917aff5898feaf8a [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
garciadeblasd40e5512017-04-21 15:09:26 +02004clean_deb:
5 rm -rf .build
6
7clean:
8 rm -rf build
9 find osm_ro -name '*.pyc' -delete
10 find osm_ro -name '*.pyo' -delete
garciadeblas9453a8a2017-03-09 16:21:24 +010011prepare:
Gennadiy Dubina311ea742017-04-03 20:46:16 +030012 pip install setuptools
garciadeblas2c290ca2017-04-06 03:12:51 +020013 mkdir -p build/
garciadeblas4b6216b2017-04-20 16:41:52 +020014 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
garciadeblas2c290ca2017-04-06 03:12:51 +020018 cp MANIFEST.in build/
garciadeblas06e6c392017-03-28 15:42:20 +020019 cp requirements.txt build/
20 cp README.rst build/
garciadeblas2c290ca2017-04-06 03:12:51 +020021 cp setup.py build/
garciadeblase5ef5172017-04-20 14:46:29 +020022 cp stdeb.cfg build/
garciadeblas2c290ca2017-04-06 03:12:51 +020023 cp -r osm_ro build/
24 cp openmano build/
garciadeblascf1826b2017-04-18 10:03:17 +020025 cp openmanod build/
garciadeblas2c290ca2017-04-06 03:12:51 +020026 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
garciadeblas9453a8a2017-03-09 16:21:24 +010031
garciadeblas06e6c392017-03-28 15:42:20 +020032connectors: prepare
33 # python-novaclient is required for that
garciadeblas2c290ca2017-04-06 03:12:51 +020034 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
garciadeblas9453a8a2017-03-09 16:21:24 +010038
garciadeblasd40e5512017-04-21 15:09:26 +020039build: clean connectors prepare
garciadeblas2c290ca2017-04-06 03:12:51 +020040 python -m py_compile build/osm_ro/*.py
garciadeblas9453a8a2017-03-09 16:21:24 +010041
garciadeblascf1826b2017-04-18 10:03:17 +020042pip: prepare
43 cd build && ./setup.py sdist
garciadeblas06e6c392017-03-28 15:42:20 +020044
garciadeblasd40e5512017-04-21 15:09:26 +020045package: clean clean_deb prepare
garciadeblas4b6216b2017-04-20 16:41:52 +020046 #apt-get install -y python-stdeb
garciadeblase5ef5172017-04-20 14:46:29 +020047 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
garciadeblasd40e5512017-04-21 15:09:26 +020050 mkdir -p .build
51 cp build/deb_dist/python-*.deb ./build/
garciadeblas06e6c392017-03-28 15:42:20 +020052
garciadeblascf1826b2017-04-18 10:03:17 +020053snap:
garciadeblas06e6c392017-03-28 15:42:20 +020054 echo "Nothing to be done yet"
55
garciadeblascf1826b2017-04-18 10:03:17 +020056install:
garciadeblase5ef5172017-04-20 14:46:29 +020057 DEBIAN_FRONTEND=noninteractive apt-get update && \
58 DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip && \
59 pip install --upgrade pip && \
garciadeblasd40e5512017-04-21 15:09:26 +020060 dpkg -i .build/*.deb
garciadeblascf1826b2017-04-18 10:03:17 +020061
62develop: prepare
garciadeblase5ef5172017-04-20 14:46:29 +020063 #pip install -r requirements.txt
garciadeblascf1826b2017-04-18 10:03:17 +020064 cd build && ./setup.py develop
65
garciadeblas06e6c392017-03-28 15:42:20 +020066test:
67 ./test/basictest.sh --force --insert-bashrc --install-openvim --init-openvim
68
Gennadiy Dubina311ea742017-04-03 20:46:16 +030069build-docker-from-source:
70 docker build -t osm/openmano -f docker/Dockerfile-local .
71
72run-docker:
73 docker-compose -f docker/openmano-compose.yml up
74
75stop-docker:
76 docker-compose -f docker/openmano-compose.yml down
77
garciadeblas9453a8a2017-03-09 16:21:24 +010078