0264be05fd607ba8565d943666460533d691b27f
[osm/osmclient.git] / Jenkinsfile
1 pipeline {
2     agent {
3         dockerfile {
4             label 'osm3'
5         }
6     }
7     stages {
8         stage("Checkout") {
9             steps {
10                 checkout scm
11                 sh '''
12                    groupadd -o -g $(id -g) -r jenkins
13                    useradd -o -u $(id -u) --create-home -r -g  jenkins jenkins
14                    '''
15             }
16         }
17         stage("Test") {
18             steps {
19                 sh 'tox'
20             }
21         }
22         stage("Build") {
23             steps {
24                 sh 'tox -e build'
25                 stash name: "deb-files", includes: "deb_dist/*.deb"
26             }
27         }
28         stage("Repo Component") {
29             steps {
30                 unstash "deb-files"
31                 sh '''
32                     mkdir -p pool/osmclient
33                     mv deb_dist/*.deb pool/osmclient/
34                     mkdir -p dists/unstable/osmclient/binary-amd64/
35                     apt-ftparchive packages pool/osmclient > dists/unstable/osmclient/binary-amd64/Packages
36                     gzip -9fk dists/unstable/osmclient/binary-amd64/Packages
37                     '''
38                 archiveArtifacts artifacts: "dists/**,pool/osmclient/*.deb"
39             }
40         }
41     }
42 }