.eggs
*venv/
*venv3/
+.tox/
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 python-nose python3-nose python-flake8 \
- python-mock python3-mock
+ libcurl4-gnutls-dev libgnutls-dev tox python-dev python3-dev \
+ debhelper python-setuptools python-all apt-utils
pipeline {
agent {
- dockerfile true
+ dockerfile {
+ label 'osm3'
+ }
}
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 'make test'
+ sh 'tox'
}
}
stage("Build") {
steps {
- sh 'make package'
+ sh 'tox -e build'
stash name: "deb-files", includes: "deb_dist/*.deb"
}
}
+++ /dev/null
-# Copyright 2017 Sandvine
-#
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-
-all: build_tools
- $(MAKE) test
- $(MAKE) package
-
-BUILD_TOOLS=python python3 virtualenv \
- libcurl4-gnutls-dev python-pip \
- python3-pip libgnutls-dev debhelper
-
-build_tools:
- sudo apt-get -y install $(BUILD_TOOLS)
-
-package:
- python setup.py --command-packages=stdeb.command bdist_deb
-
-test_flake8:
- pip install -Ur test_requirements.txt
- python setup.py flake8
-
-test_nose: test_requirements.txt
- pip install -Ur test_requirements.txt
- python setup.py test
-
-test_nose3: test_requirements.txt
- pip3 install -Ur test_requirements.txt
- python3 setup.py test
-
-test: test_flake8 test_nose test_nose3
-
-.PHONY: package build_tools test test_flake8 test_nose test_nose3
-
-clean:
- rm -rf deb_dist dist osmclient.egg-info
# python-osmclient
A python client for osm orchestration
+
# Installation
## Install dependencies
--- /dev/null
+#!/bin/sh
+#helper routine that creates user/group in docker container
+#necessary when using volumes and inputing -user into docker run
+groupadd -o -g $(id -g) -r $2
+useradd -o -u $(id -u) --create-home -r -g $2 $1
+shift 2
+exec $@
setup(
name='osmclient',
- version='0.1',
+ version_command=('git describe --tags --long --dirty', 'pep440-git'),
author='Mike Marchetti',
author_email='mmarchetti@sandvine.com',
packages=find_packages(),
install_requires=[
'Click', 'prettytable', 'pyyaml', 'pycurl'
],
+ setup_requires=['setuptools-version-command'],
test_suite='nose.collector',
entry_points='''
[console_scripts]
+++ /dev/null
-flake8
-mock
-stdeb
-nose
--- /dev/null
+[tox]
+envlist = py27,py3,flake8
+
+[testenv]
+deps=nose
+ mock
+commands=nosetests
+
+[testenv:flake8]
+basepython = python
+deps = flake8
+commands =
+ flake8 setup.py
+
+[testenv:build]
+basepython = python
+deps = stdeb
+ setuptools-version-command
+commands = python setup.py --command-packages=stdeb.command bdist_deb