Preliminar Jenkinsfile and Dockerfile; not working with agreed debian repo structure 30/1630/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 21 Apr 2017 12:33:32 +0000 (14:33 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 21 Apr 2017 12:33:32 +0000 (14:33 +0200)
Change-Id: I40e57e1e852df51d43a2a2c1d7fe893c765f7272
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Dockerfile [new file with mode: 0644]
Jenkinsfile [new file with mode: 0644]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..342e32e
--- /dev/null
@@ -0,0 +1,8 @@
+FROM ubuntu:16.04
+
+RUN add-apt-repository -y 'deb https://osm-download.etsi.org/repository/osm/debian ReleaseONE unstable' && \
+  apt-get update && \
+  DEBIAN_FRONTEND=noninteractive apt-get -y install python python-pip libmysqlclient-dev libssl-dev libffi-dev libvirt-dev && \
+  DEBIAN_FRONTEND=noninteractive pip install --upgrade pip && \
+  DEBIAN_FRONTEND=noninteractive apt-get -y install python-argcomplete python-jsonschema python-mysqldb python-paramiko python-requests python-yaml python-bottle python-libvirt
+
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644 (file)
index 0000000..b37ccf5
--- /dev/null
@@ -0,0 +1,35 @@
+pipeline {
+       agent any
+       stages {
+               stage("Build") {
+                       agent {
+                               dockerfile true
+                       }
+                       steps {
+                               sh 'make package'
+                               stash name: "deb-files", includes: ".build/*.deb"
+                       }
+               }
+               stage("Unittest") {
+                       agent {
+                               dockerfile true
+                       }
+                       steps {
+                               sh 'echo "UNITTEST"'
+                       }
+               }
+               stage("Repo Component") {
+                       steps {
+                               unstash "deb-files"
+                               sh '''
+                                       mkdir -p pool/openvim
+                                       mv ./build/*.deb pool/openvim/
+                                       mkdir -p dists/$RELEASE/openvim/binary-amd64/
+                                       apt-ftparchive packages pool/openvim > dists/$RELEASE/openvim/binary-amd64/Packages
+                                       gzip -9fk dists/$RELEASE/openvim/binary-amd64/Packages
+                                       '''
+                               archiveArtifacts artifacts: "dists/**,pool/openvim/*.deb"
+                       }
+               }
+       }
+}