From fd17d64a37b6074b69c99121a9a284dcd4acc056 Mon Sep 17 00:00:00 2001 From: Mike Marchetti Date: Wed, 24 May 2017 17:30:03 -0400 Subject: [PATCH] simplify build to use docker Signed-off-by: Mike Marchetti Change-Id: Ic70c5f279f4bda9b9605d1ab107e50dcad5cdd10 --- Dockerfile | 3 ++- Jenkinsfile | 2 +- Makefile | 37 +++++++++++-------------------------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1be5ab..28b7be9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,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 + debhelper python-stdeb apt-utils python-nose python3-nose python-flake8 \ + python-mock python3-mock diff --git a/Jenkinsfile b/Jenkinsfile index f40d65b..729fd56 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } stage("Test") { steps { - sh 'make -j4 test' + sh 'make test' } } stage("Build") { diff --git a/Makefile b/Makefile index 4fe3b77..7806fcb 100644 --- a/Makefile +++ b/Makefile @@ -23,42 +23,27 @@ BUILD_TOOLS=python python3 virtualenv \ libcurl4-gnutls-dev python-pip \ python3-pip libgnutls-dev debhelper -VENV=osmclient-venv -VENV3=osmclient-venv3 -VENV_BIN=$(VENV)/bin/python -VENV3_BIN=$(VENV3)/bin/python - -venv: $(VENV)/bin/activate -venv3: $(VENV3)/bin/activate - -$(VENV)/bin/activate: test_requirements.txt - test -d $(VENV) || virtualenv $(VENV) - $(VENV)/bin/pip install -Ur test_requirements.txt - touch $(VENV)/bin/activate - -$(VENV3)/bin/activate: test_requirements.txt - test -d $(VENV3) || virtualenv -p python3 $(VENV3) - $(VENV3)/bin/pip3 install -Ur test_requirements.txt - touch $(VENV3)/bin/activate - build_tools: sudo apt-get -y install $(BUILD_TOOLS) package: - $(VENV_BIN) setup.py --command-packages=stdeb.command bdist_deb + python setup.py --command-packages=stdeb.command bdist_deb -test_flake8: venv - $(VENV_BIN) setup.py flake8 +test_flake8: + pip install -Ur test_requirements.txt + python setup.py flake8 -test_nose: venv - $(VENV_BIN) setup.py test +test_nose: test_requirements.txt + pip install -Ur test_requirements.txt + python setup.py test -test_nose3: venv3 - $(VENV3_BIN) 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 $(VENV) $(VENV3) deb_dist dist osmclient.egg-info + rm -rf deb_dist dist osmclient.egg-info -- 2.25.1