Adds postinst script to deb package to install dependencies 66/6566/2
authorBenjamin Diaz <bdiaz@whitestack.com>
Wed, 26 Sep 2018 20:30:55 +0000 (17:30 -0300)
committerBenjamin Diaz <bdiaz@whitestack.com>
Wed, 26 Sep 2018 21:41:45 +0000 (18:41 -0300)
Adds stdeb.cfg file
Adds Makefile to handle package building
Modifies Jenkins Dockerfile to handle package building

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Ia285307ae2350c4a79eb9fd4efaf4abedd181104

Dockerfile
Makefile [new file with mode: 0644]
debian/python3-osm-mon.postinst [new file with mode: 0644]
devops-stages/stage-build.sh
setup.py
stdeb.cfg [new file with mode: 0644]

index 3fa3cfd..153a6d2 100644 (file)
@@ -24,7 +24,6 @@
 
 FROM ubuntu:16.04
 RUN  apt-get update && \
-  DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make python python-pip python3 python3-pip debhelper && \
-  DEBIAN_FRONTEND=noninteractive apt-get --yes install wget python-dev python-software-properties python-stdeb && \
-  DEBIAN_FRONTEND=noninteractive apt-get --yes install default-jre libmysqlclient-dev && \
-  DEBIAN_FRONTEND=noninteractive apt-get --yes install libmysqlclient-dev libxml2 python3-all
+  DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make python-all python3 python3-pip debhelper wget && \
+  DEBIAN_FRONTEND=noninteractive apt-get --yes install libmysqlclient-dev libxml2 python3-all && \
+  DEBIAN_FRONTEND=noninteractive pip3 install -U setuptools setuptools-version-command stdeb
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..99de6f4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,9 @@
+all: clean package
+
+clean:
+       rm -rf dist deb_dist osm_mon-*.tar.gz osm_mon.egg-info .eggs
+
+package:
+       python3 setup.py --command-packages=stdeb.command sdist_dsc
+       cp debian/python3-osm-mon.postinst deb_dist/osm-mon*/debian
+       cd deb_dist/osm-mon*/  && dpkg-buildpackage -rfakeroot -uc -us
\ No newline at end of file
diff --git a/debian/python3-osm-mon.postinst b/debian/python3-osm-mon.postinst
new file mode 100644 (file)
index 0000000..3fa26dc
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+echo "Installing python dependencies via pip..."
+pip3 install kafka==1.3.*
+pip3 install requests==2.18.*
+pip3 install cherrypy==14.0.*
+pip3 install jsmin==2.2.*
+pip3 install jsonschema==2.6.*
+pip3 install python-keystoneclient==3.15.*
+pip3 install boto==2.48
+pip3 install python-cloudwatchlogs-logging==0.0.3
+pip3 install py-cloudwatch==0.0.1
+pip3 install pyvcloud==19.1.1
+pip3 install pyopenssl==17.5.*
+pip3 install six==1.11.*
+pip3 install bottle==0.12.*
+pip3 install peewee==3.1.*
+pip3 install pyyaml==3.*
+echo "Installation of python dependencies finished"
\ No newline at end of file
index 4251b1c..8a8d332 100755 (executable)
@@ -23,7 +23,4 @@
 #__date__   = "14/Sep/2017"
 
 #!/bin/bash
-rm -rf deb_dist
-rm -rf dist
-rm -rf osm_mon.egg-info
-tox -e build
+make
index 4f2250b..6ea105c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ def parse_requirements(requirements):
 
 _name = 'osm_mon'
 _version_command = ('git describe --match v* --tags --long --dirty', 'pep440-git')
-_description = 'OSM Policy Module'
+_description = 'OSM Monitoring Module'
 _author = "Benjamín Díaz"
 _author_email = 'bdiaz@whitestack.com'
 _maintainer = 'Gianpietro Lavado'
@@ -52,7 +52,24 @@ setup(
     package_dir={_name: _name},
     scripts=['osm_mon/plugins/vRealiseOps/vROPs_Webservice/vrops_webservice',
              'osm_mon/core/message_bus/common_consumer.py'],
-    install_requires=parse_requirements('requirements.txt'),
+    install_requires=[
+        "kafka==1.3.*",
+        "requests==2.18.*",
+        "cherrypy==14.0.*",
+        "jsmin==2.2.*",
+        "jsonschema==2.6.*",
+        "python-keystoneclient==3.15.*",
+        "boto==2.48",
+        "python-cloudwatchlogs-logging==0.0.3",
+        "py-cloudwatch==0.0.1",
+        "pyvcloud==19.1.1",
+        "pyopenssl==17.5.*",
+        "six==1.11.*",
+        "bottle==0.12.*",
+        "peewee==3.1.*",
+        "pyyaml==3.*",
+        "osm-common"
+    ],
     include_package_data=True,
     dependency_links=[
         'git+https://osm.etsi.org/gerrit/osm/common.git#egg=osm-common'
diff --git a/stdeb.cfg b/stdeb.cfg
new file mode 100644 (file)
index 0000000..bc035de
--- /dev/null
+++ b/stdeb.cfg
@@ -0,0 +1,3 @@
+[DEFAULT]
+X-Python3-Version : >= 3.4
+Depends3 : libmysqlclient-dev, libssl-dev, libffi-dev, libxml2-dev, libxslt-dev, python3-pip, python3-osm-common
\ No newline at end of file