X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=Jenkinsfile;h=8c54266da23e02e7cec177ff3c70b943fa2ab791;hb=refs%2Fchanges%2F46%2F1946%2F1;hp=117749da8b3f5d2bef91db9449b3a6787073fec8;hpb=4c7e237e45bc6fe209006b4837a8e6b031e78e1c;p=osm%2Fosmclient.git diff --git a/Jenkinsfile b/Jenkinsfile index 117749d..8c54266 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 + } + } } }