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