8c54266da23e02e7cec177ff3c70b943fa2ab791
[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 '''
25                     rm -rf deb_dist
26                     tox -e build
27                    '''
28                 stash name: "deb-files", includes: "deb_dist/*.deb"
29             }
30         }
31         stage("Repo Component") {
32             steps {
33                 unstash "deb-files"
34                 sh '''
35                     rm -rf pool
36                     rm -rf dists
37                     mkdir -p pool/osmclient
38                     mv deb_dist/*.deb pool/osmclient/
39                     mkdir -p dists/unstable/osmclient/binary-amd64/
40                     apt-ftparchive packages pool/osmclient > dists/unstable/osmclient/binary-amd64/Packages
41                     gzip -9fk dists/unstable/osmclient/binary-amd64/Packages
42                     '''
43                 archiveArtifacts artifacts: "dists/**,pool/osmclient/*.deb", fingerprint: true
44             }
45         }
46     }
47 }