Fixed deployment timeout and OVSNFV plugin build
[fuel.git] / build / f_isoroot / f_ovs-nsh-dpdk-pluginbuild / Makefile
index ea95b67..5e38b4c 100644 (file)
@@ -22,22 +22,21 @@ all: .ovsbuild
 
 .PHONY: clean
 clean:
-       @rm -f .ovsbuild ../release/opnfv/fuel-plugin-ovs*.rpm fuel-plugin-ovs*.rpm
+       @rm -f .ovsbuild ../release/opnfv/fuel-plugin-ovs-*.rpm fuel-plugin-ovs-*.rpm
        @rm -f $(BUILD_BASE)/gitinfo_ovs-nsh-dpdk-plugin.txt gitinfo_ovs-nsh-dpdk-plugin.txt
 
 .PHONY: release
 release:.ovsbuild
-       @rm -f ../release/opnfv/fuel-plugin-ovs*.rpm
+       @rm -f ../release/opnfv/fuel-plugin-ovs-*.rpm
        @mkdir -p ../release/opnfv
        @cp fuel-plugin-ovs*.rpm ../release/opnfv/
        cp gitinfo_ovs-nsh-dpdk-plugin.txt $(BUILD_BASE)
-       cd $(BUILD_BASE) && mkdir -p ../deploy/templates/plugins && cp -rf $(TOP)/config/* ../deploy/templates/plugins
 
 .ovsbuild:
        @rm -rf fuel-plugin-ovs
        sudo apt-get -y install build-essential ruby-dev rubygems-integration python-pip git rpm createrepo dpkg-dev
-       sudo gem install fpm
        sudo pip install fuel-plugin-builder
+       ../../docker/ubuntu-builder/install_docker.sh
        git clone $(OVS_NSH_DPDK_REPO)
        cd fuel-plugin-ovs; \
        git checkout $(OVS_NSH_DPDK_BRANCH); \
@@ -50,6 +49,9 @@ release:.ovsbuild
        $(REPOINFO) -r . > gitinfo_ovs-nsh-dpdk-plugin.txt
        @rm -rf fuel-plugin-ovs
        @touch .ovsbuild
+       # Store artifact in cache straight away if caching is enabled
+       # (no .cacheid will be present unless this is a cached build)
+       test -f .cacheid && $(MAKE) -f Makefile put-cache || exit 0
 
 #############################################################################
 # Cache operations - only used when building through ci/build.sh
@@ -60,7 +62,11 @@ release:.ovsbuild
 #   - The SHA1 hash of the HEAD on the plugin repo's $(OVS_NSH_DPDK_BRANCH)
 #   - The contents of this Makefile
 .cacheid:
-       @git ls-remote --heads $(OVS_NSH_DPDK_REPO) | grep $(OVS_NSH_DPDK_BRANCH) | awk {'print $$1'} > .cachedata
+       @if [ ! -z $(OVS_NSH_DPDK_CHANGE) ]; then \
+         $(CACHETOOL) getcommitid $(OVS_NSH_DPDK_REPO) $(OVS_NSH_DPDK_CHANGE) > .cachedata; \
+       else \
+         $(CACHETOOL) getcommitid $(OVS_NSH_DPDK_REPO) $(OVS_NSH_DPDK_BRANCH) > .cachedata; \
+       fi
        @sha1sum Makefile | awk {'print $$1'} >> .cachedata
        @sha1sum config.mk | awk {'print $$1'} >> .cachedata
        @cat .cachedata | $(CACHETOOL) getid > .cacheid