Changes in Makefile and Jenkinsfile to follow the rest of repos 33/1633/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 21 Apr 2017 13:09:26 +0000 (15:09 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 21 Apr 2017 13:09:26 +0000 (15:09 +0200)
Change-Id: I9975870258111a04469afad44418ab94950015f0
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Jenkinsfile
Makefile

index d67084f..833bcff 100644 (file)
@@ -6,8 +6,7 @@ pipeline {
                                dockerfile true
                        }
                        steps {
-                               sh 'make clean build'
-                               sh 'make clean package'
+                               sh 'make package'
                                stash name: "deb-files", includes: ".build/*.deb"
                        }
                }
@@ -24,7 +23,7 @@ pipeline {
                                unstash "deb-files"
                                sh '''
                                        mkdir -p pool/RO
-                                       mv build/deb_dist/*.deb pool/RO/
+                                       mv .build/*.deb pool/RO/
                                        mkdir -p dists/$RELEASE/unstable/RO/binary-amd64/
                                        apt-ftparchive packages pool/RO > dists/$RELEASE/unstable/RO/binary-amd64/Packages
                                        gzip -9fk dists/$RELEASE/unstable/RO/binary-amd64/Packages
index b5f6ac5..71425c6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,13 @@
 SHELL := /bin/bash
 all: package install
 
+clean_deb:
+       rm -rf .build
+
+clean:
+       rm -rf build
+       find osm_ro -name '*.pyc' -delete
+       find osm_ro -name '*.pyo' -delete
 prepare:
        pip install setuptools
        mkdir -p build/
@@ -29,17 +36,19 @@ connectors: prepare
        python build/osm_ro/openmanolinkervimconn.py
        rm -f build/osm_ro/openmanolinkervimconn.py
 
-build: connectors prepare
+build: clean connectors prepare
        python -m py_compile build/osm_ro/*.py
 
 pip: prepare
        cd build && ./setup.py sdist
 
-package: prepare
+package: clean clean_deb prepare
        #apt-get install -y python-stdeb
        cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
        cd build && cp osm_ro/scripts/python-osm-ro.postinst deb_dist/osm-ro*/debian/
        cd build/deb_dist/osm-ro* && dpkg-buildpackage -rfakeroot -uc -us
+       mkdir -p .build
+       cp build/deb_dist/python-*.deb ./build/
 
 snap:
        echo "Nothing to be done yet"
@@ -48,7 +57,7 @@ install:
        DEBIAN_FRONTEND=noninteractive apt-get update && \
        DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip && \
        pip install --upgrade pip && \
-       dpkg -i build/deb_dist/*.deb
+       dpkg -i .build/*.deb
 
 develop: prepare
        #pip install -r requirements.txt
@@ -66,8 +75,4 @@ run-docker:
 stop-docker:
        docker-compose -f docker/openmano-compose.yml down
 
-clean:
-       rm -rf build
-       find osm_ro -name '*.pyc' -delete
-       find osm_ro -name '*.pyo' -delete