1 # Copyright 2018 Telefonica S.A.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 .PHONY
: all test clean
22 all: # lib-openvim # osm-im
23 $(MAKE
) clean_build build
24 $(MAKE
) clean_build package
27 rm -rf .build openvim IM
31 find osm_ro
-name
'*.pyc' -delete
32 find osm_ro
-name
'*.pyo' -delete
35 # ip install --user --upgrade setuptools
37 # VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
38 # VER2=$(shell git describe | cut -d- -f2); \
39 # VER3=$(shell git describe | cut -d- -f3); \
40 # echo "$$VER1.dev$$VER2+$$VER3" > build/RO_VERSION
43 cp requirements.txt build
/
50 cp
-r vnfs build
/osm_ro
51 cp
-r scenarios build
/osm_ro
52 cp
-r instance-scenarios build
/osm_ro
53 cp
-r scripts build
/osm_ro
54 cp
-r database_utils build
/osm_ro
55 cp LICENSE build
/osm_ro
58 # python-novaclient is required for that
59 rm -f build
/osm_ro
/openmanolinkervimconn.py
60 cd build
/osm_ro
; for i in
`ls vimconn_*.py |sed "s/\.py//"` ; do echo
"import $$i" >> openmanolinkervimconn.py
; done
61 python build
/osm_ro
/openmanolinkervimconn.py
2>&1
62 rm -f build
/osm_ro
/openmanolinkervimconn.py
64 build
: connectors prepare
65 python
-m py_compile build
/osm_ro
/*.py
66 # cd build && tox -e flake8
69 $(shell git clone https
://osm.etsi.org
/gerrit
/osm
/openvim
)
70 LIB_BRANCH
=$(shell git
-C openvim branch
-a|grep
-oP
'remotes/origin/\K$(BRANCH)'); \
71 [ -z
"$$LIB_BRANCH" ] && LIB_BRANCH
='master'; \
72 echo
"BRANCH: $(BRANCH)"; \
73 echo
"LIB_OPENVIM_BRANCH: $$LIB_BRANCH"; \
74 git
-C openvim checkout
$$LIB_BRANCH
75 make
-C openvim
clean lite
78 $(shell git clone https
://osm.etsi.org
/gerrit
/osm
/IM
)
82 # apt-get install -y python-stdeb
83 cd build
&& python setup.py
--command-packages
=stdeb.command sdist_dsc
--with-python2
=True
84 cd build
&& cp osm_ro
/scripts
/python-osm-ro.postinst deb_dist
/osm-ro
*/debian
/
85 cd build
/deb_dist
/osm-ro
* && dpkg-buildpackage
-rfakeroot
-uc
-us
87 cp build
/deb_dist
/python-
*.deb .build
/
90 echo
"Nothing to be done yet"
92 install: lib-openvim osm-im
93 dpkg
-i IM
/deb_dist
/python-osm-im
*.deb
94 dpkg
-i openvim
/.build
/python-lib-osm-openvim
*.deb
95 dpkg
-i .build
/python-osm-ro
*.deb
97 OSMLIBOVIM_PATH
=`python -c 'import lib_osm_openvim; print lib_osm_openvim.__path__[0]'` || FATAL
"lib-osm-openvim was not properly installed" && \
98 OSMRO_PATH
=`python -c 'import osm_ro; print osm_ro.__path__[0]'` || FATAL
"osm-ro was not properly installed" && \
99 USER
=root DEBIAN_FRONTEND
=noninteractive
$$OSMRO_PATH/database_utils
/install-db-server.sh
--updatedb || FATAL
"osm-ro db installation failed" && \
100 USER
=root DEBIAN_FRONTEND
=noninteractive
$$OSMLIBOVIM_PATH/database_utils
/install-db-server.sh
-u mano
-p manopw
-d mano_vim_db
--updatedb || FATAL
"lib-osm-openvim db installation failed"
101 service osm-ro restart
104 # pip install -r requirements.txt
105 cd build
&& .
/setup.py develop
108 . .
/test/basictest.sh
-f
--insert-bashrc
--install-openvim
--init-openvim
109 . .
/test/basictest.sh
-f reset add-openvim
110 .
/test/test_RO.py deploy
-n mgmt
-t osm
-i cirros034
-d local-openvim
--timeout
=30 --failfast
111 .
/test/test_RO.py vim
-t osm
-d local-openvim
--timeout
=30 --failfast
113 build-docker-from-source
:
114 docker build
-t osm
/openmano
-f docker
/Dockerfile-local .
117 docker-compose
-f docker
/openmano-compose.yml up
120 docker-compose
-f docker
/openmano-compose.yml down