Change-Id: I68dbd848697a2407bea81797a9af06399edda3de
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
FROM ubuntu:16.04
RUN apt-get update && \
FROM ubuntu:16.04
RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install git build-essential && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python python-dev python-all python-stdeb fakeroot pypi2deb && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python-pip libmysqlclient-dev libssl-dev libffi-dev libvirt-dev && \
- DEBIAN_FRONTEND=noninteractive pip install --upgrade pip && \
- DEBIAN_FRONTEND=noninteractive pip install --upgrade setuptools && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python-argcomplete python-jsonschema python-logutils python-mysqldb python-paramiko python-requests python-yaml python-bottle python-libvirt
+ DEBIAN_FRONTEND=noninteractive apt-get -y install git make python python-pip debhelper && \
+ DEBIAN_FRONTEND=noninteractive pip install -U pip && \
+ DEBIAN_FRONTEND=noninteractive pip install -U setuptools setuptools-version-command stdeb
+
+#include OPENVIM_VERSION
include openflow
include openvimd
include openvim
include openflow
include openvimd
include openvim
+.PHONY: all test clean
+
-all: clean build pip install
-lite: clean build_lite pip_lite install_lite
+all:
+ $(MAKE) clean_build build
+ $(MAKE) clean_build openvim
+ $(MAKE) clean_build build_lite
+ $(MAKE) clean_build lite
+
+openvim: package_openvim
+
+lite: package_lib_openvim
rm -rf build
find osm_openvim -name '*.pyc' -delete
find osm_openvim -name '*.pyo' -delete
prepare_lite:
rm -rf build
find osm_openvim -name '*.pyc' -delete
find osm_openvim -name '*.pyo' -delete
prepare_lite:
- pip install --user --upgrade setuptools
+ #pip install --user --upgrade setuptools
- VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
- VER2=$(shell git describe | cut -d- -f2); \
- VER3=$(shell git describe | cut -d- -f3); \
- echo "$$VER1.dev$$VER2+$$VER3" > build/OVIM_VERSION
+ #VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
+ #VER2=$(shell git describe | cut -d- -f2); \
+ #VER3=$(shell git describe | cut -d- -f3); \
+ #echo "$$VER1.dev$$VER2+$$VER3" > build/OVIM_VERSION
+ cp tox.ini build/
- sed -i "s/include OPENVIM_VERSION/include OVIM_VERSION/g" build/MANIFEST.in
+ #sed -i "s/include OPENVIM_VERSION/include OVIM_VERSION/g" build/MANIFEST.in
sed -i "s/recursive-include osm_openvim/recursive-include lib_osm_openvim/g" build/MANIFEST.in
sed -i "s/include openflow/include openflow-lib/g" build/MANIFEST.in
sed -i '/include openvimd/d' build/MANIFEST.in
sed -i "s/recursive-include osm_openvim/recursive-include lib_osm_openvim/g" build/MANIFEST.in
sed -i "s/include openflow/include openflow-lib/g" build/MANIFEST.in
sed -i '/include openvimd/d' build/MANIFEST.in
sed -i "s/__import__(\"osm_openvim\.\"/__import__(\"lib_osm_openvim\.\"/g" build/lib_osm_openvim/ovim.py
prepare:
sed -i "s/__import__(\"osm_openvim\.\"/__import__(\"lib_osm_openvim\.\"/g" build/lib_osm_openvim/ovim.py
prepare:
- pip install --user --upgrade setuptools
+ #pip install --user --upgrade setuptools
- VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
- VER2=$(shell git describe | cut -d- -f2); \
- VER3=$(shell git describe | cut -d- -f3); \
- echo "$$VER1.dev$$VER2+$$VER3" > build/OPENVIM_VERSION
+ #VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
+ #VER2=$(shell git describe | cut -d- -f2); \
+ #VER3=$(shell git describe | cut -d- -f3); \
+ #echo "$$VER1.dev$$VER2+$$VER3" > build/OPENVIM_VERSION
+ cp tox.ini build/
cp MANIFEST.in build/
cp README.rst build/
cp setup.py build/
cp MANIFEST.in build/
cp README.rst build/
cp setup.py build/
build: prepare
python -m py_compile build/osm_openvim/*.py
build: prepare
python -m py_compile build/osm_openvim/*.py
+ #cd build && tox -e flake8
build_lite: prepare_lite
python -m py_compile build/lib_osm_openvim/*.py
build_lite: prepare_lite
python -m py_compile build/lib_osm_openvim/*.py
+ #cd build && tox -e flake8
cd build && ./setup.py sdist
cd build && ./setup.py sdist
-pip_lite: clean build_lite
cd build && ./setup.py sdist
cd build && ./setup.py sdist
-package_openvim: clean prepare
+package_openvim: prepare
#apt-get install -y python-stdeb
cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
cd build && cp osm_openvim/scripts/python-osm-openvim.postinst deb_dist/osm-openvim*/debian/
#apt-get install -y python-stdeb
cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
cd build && cp osm_openvim/scripts/python-osm-openvim.postinst deb_dist/osm-openvim*/debian/
mkdir -p .build
cp build/deb_dist/python-*.deb .build/
mkdir -p .build
cp build/deb_dist/python-*.deb .build/
-package_lib: clean prepare_lite
+package_lib_openvim: prepare_lite
#apt-get install -y python-stdeb
#apt-get install -y python-stdeb
- cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
- cd build/deb_dist/lib-osm-openvim* && dpkg-buildpackage -rfakeroot -uc -us
+ #cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
+ #cd build/deb_dist/lib-osm-openvim* && dpkg-buildpackage -rfakeroot -uc -us
+ cd build && python setup.py --command-packages=stdeb.command bdist_deb
mkdir -p .build
cp build/deb_dist/python-*.deb .build/
mkdir -p .build
cp build/deb_dist/python-*.deb .build/
-package: clean_deb package_openvim package_lib
-
snap:
echo "Nothing to be done yet"
snap:
echo "Nothing to be done yet"
from setuptools import setup
__name = 'osm_openvim'
from setuptools import setup
__name = 'osm_openvim'
-__version = open('OPENVIM_VERSION').read().strip()
__description = 'OSM Openvim'
__author = 'ETSI OSM'
__author_email = 'alfonso.tiernosepulveda@telefonica.com'
__description = 'OSM Openvim'
__author = 'ETSI OSM'
__author_email = 'alfonso.tiernosepulveda@telefonica.com'
__url = 'https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=summary'
_req = [
__url = 'https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=summary'
_req = [
"cffi",
"enum34",
"functools32",
"cffi",
"enum34",
"functools32",
"requestsexceptions",
"netaddr",
"bottle",
"requestsexceptions",
"netaddr",
"bottle",
+ #"MySQL-python",
+ #"mysqlclient",
"paramiko",
"libvirt-python",
"pytest",
"paramiko",
"libvirt-python",
"pytest",
'osm_openvim/scripts/get_dhcp_lease.sh']
setup(name=__name,
'osm_openvim/scripts/get_dhcp_lease.sh']
setup(name=__name,
+ version_command=('git describe', 'pep440-git'),
description=__description,
long_description=__description,
author=__author,
description=__description,
long_description=__description,
author=__author,
data_files = [('/etc/osm/', ['osm_openvim/openvimd.cfg']),
('/etc/systemd/system/', ['osm_openvim/osm-openvim.service']),
],
data_files = [('/etc/osm/', ['osm_openvim/openvimd.cfg']),
('/etc/systemd/system/', ['osm_openvim/osm-openvim.service']),
],
+ install_requires=_req,
+ setup_requires=['setuptools-version-command'],
from setuptools import setup
__name = 'lib_osm_openvim'
from setuptools import setup
__name = 'lib_osm_openvim'
-__version = open('OVIM_VERSION').read().strip()
__description = 'OSM Openvim library'
__author = 'ETSI OSM'
__author_email = 'alfonso.tiernosepulveda@telefonica.com'
__description = 'OSM Openvim library'
__author = 'ETSI OSM'
__author_email = 'alfonso.tiernosepulveda@telefonica.com'
__url = 'https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=summary'
_req = [
__url = 'https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=summary'
_req = [
"cffi",
"enum34",
"functools32",
"cffi",
"enum34",
"functools32",
"requestsexceptions",
"netaddr",
"bottle",
"requestsexceptions",
"netaddr",
"bottle",
+ #"MySQL-python",
+ #"mysqlclient",
"paramiko"
]
__scripts__ = ['openflow-lib']
setup(name=__name,
"paramiko"
]
__scripts__ = ['openflow-lib']
setup(name=__name,
+ version_command=('git describe', 'pep440-git'),
description=__description,
long_description=__description,
author=__author,
description=__description,
long_description=__description,
author=__author,
scripts=__scripts__,
package_data={'lib_osm_openvim': ['*']},
include_package_data=True,
scripts=__scripts__,
package_data={'lib_osm_openvim': ['*']},
include_package_data=True,
+ install_requires=_req,
+ setup_requires=['setuptools-version-command'],
--- /dev/null
+[tox]
+#envlist = py27,py3
+envlist = py27
+toxworkdir={homedir}/.tox
+
+[testenv]
+deps=nose
+ mock
+commands=nosetests
+
+[testenv:flake8]
+basepython = python
+deps = flake8
+commands =
+ flake8 setup.py
+
+[testenv:build]
+basepython = python
+deps = stdeb
+ setuptools-version-command
+commands = python setup.py --command-packages=stdeb.command bdist_deb
+