add devops stages for pipeline 92/5992/1
authorMike Marchetti <mmarchetti@sandvine.com>
Wed, 18 Apr 2018 14:52:18 +0000 (10:52 -0400)
committerMike Marchetti <mmarchetti@sandvine.com>
Wed, 18 Apr 2018 15:10:13 +0000 (11:10 -0400)
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
Dockerfile [new file with mode: 0644]
Jenkinsfile [new file with mode: 0644]
devops-stages/stage-archive.sh [new file with mode: 0755]
devops-stages/stage-build.sh [new file with mode: 0755]
devops-stages/stage-test.sh [new file with mode: 0755]
tox.ini

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..b81e0da
--- /dev/null
@@ -0,0 +1,5 @@
+FROM ubuntu:16.04
+
+RUN apt-get update && apt-get -y install git make python3 \
+    libcurl4-gnutls-dev libgnutls-dev tox python3-dev \
+    debhelper python3-setuptools python3-all apt-utils
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644 (file)
index 0000000..ed9e879
--- /dev/null
@@ -0,0 +1,32 @@
+properties([
+    parameters([
+        string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'),
+        string(defaultValue: 'osm/N2VC', description: '', name: 'GERRIT_PROJECT'),
+        string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'),
+        string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'),
+        string(defaultValue: 'https://osm.etsi.org/gerrit', description: '', name: 'PROJECT_URL_PREFIX'),
+        booleanParam(defaultValue: false, description: '', name: 'TEST_INSTALL'),
+        string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'),
+    ])
+])
+
+def devops_checkout() {
+    dir('devops') {
+        git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH
+    }
+}
+
+node('docker') {
+    checkout scm
+    devops_checkout()
+
+    ci_stage_2 = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy"
+    ci_stage_2.ci_pipeline( 'N2VC',
+                           params.PROJECT_URL_PREFIX,
+                           params.GERRIT_PROJECT,
+                           params.GERRIT_BRANCH,
+                           params.GERRIT_REFSPEC,
+                           params.GERRIT_PATCHSET_REVISION,
+                           params.TEST_INSTALL,
+                           params.ARTIFACTORY_SERVER)
+}
diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh
new file mode 100755 (executable)
index 0000000..e3d589f
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+MDG=N2VC
+rm -rf pool
+rm -rf dists
+mkdir -p pool/$MDG
+mv deb_dist/*.deb pool/$MDG/
+mkdir -p dists/unstable/$MDG/binary-amd64/
+apt-ftparchive packages pool/$MDG > dists/unstable/$MDG/binary-amd64/Packages
+gzip -9fk dists/unstable/$MDG/binary-amd64/Packages
+echo "dists/**,pool/$MDG/*.deb"
diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh
new file mode 100755 (executable)
index 0000000..bf7602b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -rf deb_dist
+tox -e build
diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh
new file mode 100755 (executable)
index 0000000..0333d84
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+#tox
diff --git a/tox.ini b/tox.ini
index ff6431e..502214f 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -23,3 +23,9 @@ commands =
     flake8 --ignore E501 {posargs} juju tests
 deps =
     flake8
+
+[testenv:build]
+basepython = python3
+deps = stdeb
+       setuptools-version-command
+commands = python3 setup.py --command-packages=stdeb.command bdist_deb