From: Mike Marchetti Date: Wed, 24 May 2017 21:30:03 +0000 (-0400) Subject: simplify build to use docker X-Git-Tag: v2.0.1~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F1869%2F2;p=osm%2Fosmclient.git simplify build to use docker Signed-off-by: Mike Marchetti Change-Id: Ic70c5f279f4bda9b9605d1ab107e50dcad5cdd10 --- 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