From: Mike Marchetti Date: Tue, 9 May 2017 17:02:32 +0000 (-0400) Subject: add dockerfile for pipeline, nose X-Git-Tag: v2.0.0~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F1802%2F1;p=osm%2Fosmclient.git add dockerfile for pipeline, nose - ready dockerfile for pipeline - add nose support for test search Signed-off-by: Mike Marchetti --- diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f1be5ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get -y install git make python python3 \ + virtualenv libcurl4-gnutls-dev libgnutls-dev python-pip python3-pip \ + debhelper python-stdeb apt-utils diff --git a/Jenkinsfile b/Jenkinsfile index 117749d..f40d65b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,36 @@ -node { - stage("Checkout") { - checkout scm +pipeline { + agent { + dockerfile true } - 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 + } + } + stage("Test") { + steps { + sh 'make -j4 test' + } + } + stage("Build") { + steps { + sh 'make package' + stash name: "deb-files", includes: "deb_dist/*.deb" + } + } + stage("Repo Component") { + steps { + unstash "deb-files" + sh ''' + 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" + } + } } } diff --git a/Makefile b/Makefile index c8b6c39..4fe3b77 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ $(VENV3)/bin/activate: test_requirements.txt build_tools: sudo apt-get -y install $(BUILD_TOOLS) -package: build_tools +package: $(VENV_BIN) setup.py --command-packages=stdeb.command bdist_deb test_flake8: venv diff --git a/setup.py b/setup.py index c250356..ad92135 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ setup( install_requires=[ 'Click', 'prettytable', 'pyyaml', 'pycurl' ], + test_suite='nose.collector', entry_points=''' [console_scripts] osm=osmclient.scripts.osm:cli