Add fingerprint to archive
[osm/osmclient.git] / Jenkinsfile
index 117749d..8c54266 100644 (file)
@@ -1,24 +1,47 @@
-node {
-    stage("Checkout") {
-        checkout scm
+pipeline {
+    agent {
+        dockerfile {
+            label 'osm3'
+        }
     }
-    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
+                sh '''
+                   groupadd -o -g $(id -g) -r jenkins
+                   useradd -o -u $(id -u) --create-home -r -g  jenkins jenkins
+                   '''
+            }
+        }
+        stage("Test") {
+            steps {
+                sh 'tox'
+            }
+        }
+        stage("Build") {
+            steps {
+                sh '''
+                    rm -rf deb_dist
+                    tox -e build
+                   '''
+                stash name: "deb-files", includes: "deb_dist/*.deb"
+            }
+        }
+        stage("Repo Component") {
+            steps {
+                unstash "deb-files"
+                sh '''
+                    rm -rf pool
+                    rm -rf dists
+                    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", fingerprint: true
+            }
+        }
     }
 }