.settings
#local stuff files that end in ".local" or folders called "local"
-*.local
+local
osm_nbi/local
osm_nbi/test/local
osm_nbi/temp
osm_nbi/test/temp
+#distribution and package generation
+build
+dist
+*.egg-info
+# This Dockerfile is intented for devops and deb package generation
+#
+# Use Dockerfile.local for running osm/NBI in a docker container
+
+
FROM ubuntu:16.04
RUN apt-get update && apt-get -y install git make python python3 \
-.PHONY: all test clean
-
-SHELL := /bin/bash
-
-BRANCH ?= master
-
-all:
- $(MAKE) clean_build build
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+OUT_DIR := osm_im
+TREES_DIR := osm_im_trees
+Q?=@
+
+all: package
$(MAKE) clean_build package
clean: clean_build
- rm -rf .build
+ $(Q)rm -rf build dist osm_nbi.egg-info deb deb_dist *.gz $(OUT_DIR) $(TREES_DIR)
clean_build:
rm -rf build
find osm_nbi -name '*.pyc' -delete
find osm_nbi -name '*.pyo' -delete
-prepare:
- mkdir -p build/
- cp tox.ini build/
- cp MANIFEST.in build/
- cp requirements.txt build/
- cp README.rst build/
- cp setup.py build/
- cp stdeb.cfg build/
- cp -r osm_nbi build/
- cp LICENSE build/osm_nbi
-
-
-package: prepare
-# apt-get install -y python-stdeb
- cd build && python3 setup.py --command-packages=stdeb.command sdist_dsc # --with-python2=False
- cd build/deb_dist/osm-nbi-* && dpkg-buildpackage -rfakeroot -uc -us
- mkdir -p .build
- cp build/deb_dist/python3-*.deb .build/
-
-snap:
- echo "Nothing to be done yet"
-
-install: package
- dpkg -i .build/python-osm-nbi*.deb
- cd .. && \
- OSMLIBOVIM_PATH=`python -c 'import lib_osm_openvim; print lib_osm_openvim.__path__[0]'` || FATAL "lib-osm-openvim was not properly installed" && \
- OSMNBI_PATH=`python3 -c 'import osm_nbi; print(osm_nbi.__path__[0])'` || FATAL "osm-nbi was not properly installed" && \
- service osm-nbi restart
-
-develop: prepare
-# pip install -r requirements.txt
- cd build && ./setup.py develop
+package:
+ tox -e build
test:
echo "TODO"
===========
osm-nbi is the North Bound Interface for OSM, REST client serving json/yaml
-It also implements a functional html web server
-
+It follows ETSI SOL005 recomendations
--- /dev/null
+0.1.3
+Apr 2018
+
from os import environ
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
-__version__ = "0.3"
+
+# TODO consider to remove and provide version using the static version file
+__version__ = "0.1.3"
version_date = "Apr 2018"
database_version = '1.0'
@cherrypy.expose
def version(self, *args, **kwargs):
+ # TODO consider to remove and provide version using the static version file
global __version__, version_date
try:
if cherrypy.request.method != "GET":
Description=NBI server (OSM NBI)
[Service]
-ExecStart=/usr/bin/nbi -c /etc/osm/nbi.cfg --log-file=/var/log/osm/nbi.log
+ExecStart=/usr/bin/nbi.py -c /etc/osm/nbi.cfg --log-file=/var/log/osm/nbi.log
Restart=always
[Install]
#!/usr/bin/env python3
-from setuptools import setup #, find_packages
+import os
+from setuptools import setup
+here = os.path.abspath(os.path.dirname(__file__))
_name = "osm_nbi"
+VERSION = "0.1.3"
+README = open(os.path.join(here, 'README.rst')).read()
setup(
name=_name,
description='OSM North Bound Interface',
+ long_description=README,
# version_command=('git describe --tags --long --dirty', 'pep440-git'),
- version="0.1.0",
+ version=VERSION,
+ python_requires='>3.5.0',
author='ETSI OSM',
author_email='alfonso.tiernosepulveda@telefonica.com',
maintainer='Alfonso Tierno',
url='https://osm.etsi.org/gitweb/?p=osm/NBI.git;a=summary',
license='Apache 2.0',
- packages=[_name], # find_packages(),
+ packages=[_name],
include_package_data=True,
data_files=[('/etc/osm/', ['osm_nbi/nbi.cfg']),
('/etc/systemd/system/', ['osm_nbi/osm-nbi.service']),
install_requires=[
'CherryPy', 'pymongo', 'jsonschema'
+ # 'PyYAML',
],
-# setup_requires=['setuptools-version-command'],
+ # setup_requires=['setuptools-version-command'],
# test_suite='nose.collector',
# entry_points='''
# [console_scripts]
# osm=osm_nbi.nbi:nbi
# ''',
)
+