add dockerfile for pipeline, nose 02/1802/1
authorMike Marchetti <mmarchetti@sandvine.com>
Tue, 9 May 2017 17:02:32 +0000 (13:02 -0400)
committerMike Marchetti <mmarchetti@sandvine.com>
Tue, 9 May 2017 17:02:32 +0000 (13:02 -0400)
- ready dockerfile for pipeline
- add nose support for test search
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
Dockerfile [new file with mode: 0644]
Jenkinsfile
Makefile
setup.py

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..f1be5ab
--- /dev/null
@@ -0,0 +1,5 @@
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get -y install git make python python3 \
+    virtualenv libcurl4-gnutls-dev libgnutls-dev python-pip  python3-pip \
+    debhelper python-stdeb apt-utils
index 117749d..f40d65b 100644 (file)
@@ -1,24 +1,36 @@
-node {
-    stage("Checkout") {
-        checkout scm
+pipeline {
+    agent {
+        dockerfile true
     }
-    stage("Test") {
-        sh 'make test'
-    }
-    stage("Build") {
-        sh 'make package'
-        stash name: "deb-files", includes: "deb_dist/*.deb"
-    }
-    stage("Repo Component") {
-        releaseDir = "ReleaseTWO"
-        unstash "deb-files"
-        sh '''
-            mkdir -p pool/osmclient
-            mv deb_dist/*.deb pool/osmclient/
-            mkdir -p dists/${releaseDir}/unstable/osmclient/binary-amd64/
-            apt-ftparchive packages pool/osmclient > dists/${releaseDir}/unstable/osmclient/binary-amd64/Packages
-            gzip -9fk dists/${releaseDir}/unstable/osmclient/binary-amd64/Packages
-            '''
-        archiveArtifacts artifacts: "dists/**,pool/osmclient/*.deb"
+    stages {
+        stage("Checkout") {
+            steps {
+                checkout scm
+            }
+        }
+        stage("Test") {
+            steps {
+                sh 'make -j4 test'
+            }
+        }
+        stage("Build") {
+            steps {
+                sh 'make package'
+                stash name: "deb-files", includes: "deb_dist/*.deb"
+            }
+        }
+        stage("Repo Component") {
+            steps {
+                unstash "deb-files"
+                sh '''
+                    mkdir -p pool/osmclient
+                    mv deb_dist/*.deb pool/osmclient/
+                    mkdir -p dists/unstable/osmclient/binary-amd64/
+                    apt-ftparchive packages pool/osmclient > dists/unstable/osmclient/binary-amd64/Packages
+                    gzip -9fk dists/unstable/osmclient/binary-amd64/Packages
+                    '''
+                archiveArtifacts artifacts: "dists/**,pool/osmclient/*.deb"
+            }
+        }
     }
 }
index c8b6c39..4fe3b77 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,7 @@ $(VENV3)/bin/activate: test_requirements.txt
 build_tools:
        sudo apt-get -y install $(BUILD_TOOLS)
 
-package: build_tools
+package:
        $(VENV_BIN) setup.py --command-packages=stdeb.command bdist_deb
 
 test_flake8: venv
index c250356..ad92135 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -10,6 +10,7 @@ setup(
     install_requires=[
         'Click', 'prettytable', 'pyyaml', 'pycurl'
     ],
+    test_suite='nose.collector',
     entry_points='''
         [console_scripts]
         osm=osmclient.scripts.osm:cli