From: Mike Marchetti Date: Wed, 18 Apr 2018 14:52:18 +0000 (-0400) Subject: add devops stages for pipeline X-Git-Tag: v4.0.0~7 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=refs%2Fchanges%2F92%2F5992%2F1;ds=sidebyside add devops stages for pipeline Signed-off-by: Mike Marchetti --- diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b81e0da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get -y install git make python3 \ + libcurl4-gnutls-dev libgnutls-dev tox python3-dev \ + debhelper python3-setuptools python3-all apt-utils diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..ed9e879 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +properties([ + parameters([ + string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'), + string(defaultValue: 'osm/N2VC', description: '', name: 'GERRIT_PROJECT'), + string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'), + string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'), + string(defaultValue: 'https://osm.etsi.org/gerrit', description: '', name: 'PROJECT_URL_PREFIX'), + booleanParam(defaultValue: false, description: '', name: 'TEST_INSTALL'), + string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'), + ]) +]) + +def devops_checkout() { + dir('devops') { + git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH + } +} + +node('docker') { + checkout scm + devops_checkout() + + ci_stage_2 = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy" + ci_stage_2.ci_pipeline( 'N2VC', + params.PROJECT_URL_PREFIX, + params.GERRIT_PROJECT, + params.GERRIT_BRANCH, + params.GERRIT_REFSPEC, + params.GERRIT_PATCHSET_REVISION, + params.TEST_INSTALL, + params.ARTIFACTORY_SERVER) +} diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh new file mode 100755 index 0000000..e3d589f --- /dev/null +++ b/devops-stages/stage-archive.sh @@ -0,0 +1,10 @@ +#!/bin/sh +MDG=N2VC +rm -rf pool +rm -rf dists +mkdir -p pool/$MDG +mv deb_dist/*.deb pool/$MDG/ +mkdir -p dists/unstable/$MDG/binary-amd64/ +apt-ftparchive packages pool/$MDG > dists/unstable/$MDG/binary-amd64/Packages +gzip -9fk dists/unstable/$MDG/binary-amd64/Packages +echo "dists/**,pool/$MDG/*.deb" diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh new file mode 100755 index 0000000..bf7602b --- /dev/null +++ b/devops-stages/stage-build.sh @@ -0,0 +1,3 @@ +#!/bin/sh +rm -rf deb_dist +tox -e build diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh new file mode 100755 index 0000000..0333d84 --- /dev/null +++ b/devops-stages/stage-test.sh @@ -0,0 +1,2 @@ +#!/bin/sh +#tox diff --git a/tox.ini b/tox.ini index ff6431e..502214f 100644 --- a/tox.ini +++ b/tox.ini @@ -23,3 +23,9 @@ commands = flake8 --ignore E501 {posargs} juju tests deps = flake8 + +[testenv:build] +basepython = python3 +deps = stdeb + setuptools-version-command +commands = python3 setup.py --command-packages=stdeb.command bdist_deb