diff options
author | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2015-03-22 23:04:43 +0100 |
---|---|---|
committer | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2015-03-26 17:26:27 +0100 |
commit | 2de197be04b871b437e35b55ca7f48d921595303 (patch) | |
tree | b2f812d507ac3037153c11a5f19ea6db5c27009e /fuel/build/opendaylight | |
parent | a5a094a199226f312e795c3019c5793094e5378e (diff) |
Fuel build cache handling
- Cache invalidation supported in case cache is outdated compared to upstream.
- Fully automated build.sh integration tests added (build.sh -t or build.sh -T)
- Rebased to Daniel Smiths's patch-set: genesis refs/changes/71/171/4
- Yet untested, will perform automated integration tests over night!
- Updated based on Stefan's comments (no more revs.)
- Fixed a bug in f_odl_docker/Makefile
- validate-cache target added in f_odl_docker/Makefile
JIRA: BGS-1
Change-Id: I9f8f30c2a85fd7bf04dab1b566065e5739d4fcb1
Signed-off-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
Diffstat (limited to 'fuel/build/opendaylight')
l--------- | fuel/build/opendaylight/ | 1 | ||||
-rw-r--r-- | fuel/build/opendaylight/Makefile | 27 | ||||
-rw-r--r-- | fuel/build/opendaylight/f_odl/Makefile | 4 |
3 files changed, 27 insertions, 5 deletions
diff --git a/fuel/build/opendaylight/ b/fuel/build/opendaylight/ new file mode 120000 index 0000000..0519ecb --- /dev/null +++ b/fuel/build/opendaylight/ @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/fuel/build/opendaylight/Makefile b/fuel/build/opendaylight/Makefile index c112ff6..bd2eeb5 100644 --- a/fuel/build/opendaylight/Makefile +++ b/fuel/build/opendaylight/Makefile @@ -12,7 +12,7 @@ # BEGIN of variables to customize # SHELL = /bin/bash -include ../config.mk + BUILD_DIR := $(shell pwd) GIT_DIR := /tmp @@ -32,14 +32,31 @@ MAVEN_SPEC = $(BUILD_DIR)/odl_maven/settings.xml .PHONY: all all: odl +############################################################################ +# BEGIN of Include definitions +# +include ../config.mk +# +# END Include definitions +############################################################################# + .PHONY: setup setup: rm -f "$(BUILD_BASE)/f_odl" ln -s "$(shell readlink -e $(BUILD_DIR))/f_odl" "$(shell readlink -e $(BUILD_BASE))/f_odl" -.PHONY: check-cache-validity -check-cache-validity: - @if [ $(git ls-remote $(ODL_MAIN_REPO) $(ODL_MAIN_TAG) | awk '{print $(NF-1)}') -ne $(cat $(CACHE_DIR)/.versions | grep odl | awk '{print $NF}') ]; then @echo "Cache is not up to date, stopping!"; exit 1; fi +.PHONY: validate-cache +validate-cache: + @REMOTE_ID=$(shell git ls-remote $(ODL_MAIN_REPO) $(ODL_MAIN_TAG)^{} | awk '{print $$(NF-1)}'); \ + if [ -z $$REMOTE_ID ] || [ $$REMOTE_ID = " " ]; \ + then \ + REMOTE_ID=$(shell git ls-remote $(ODL_MAIN_REPO) $(ODL_MAIN_TAG) | awk '{print $$(NF-1)}'); \ + fi; \ + if [ $$REMOTE_ID != $(shell cat $(VERSION_FILE) | grep odl | awk '{print $$NF}') ]; \ + then \ + echo "Cache does not match upstream OpenDaylight, cache must be rebuilt!"; \ + exit 1; \ + fi .PHONY: odl odl: @@ -69,7 +86,7 @@ else mvn -gs $(MAVEN_SPEC) clean install;\ fi; - @echo "odl" `git -C /tmp/controller show | grep commit | rev | cut -f1 -d " "` >> $(BUILD_BASE)/.versions + @echo "odl" `git -C /tmp/controller show | grep commit | head -1 | cut -d " " -f2` >> $(VERSION_FILE) @./make-odl-deb.sh -N $(ODL_SHORT_NAME)_`cd /tmp/controller; git rev-parse --short HEAD` -n $(ODL_SHORT_NAME) -v "$(ODL_VERSION)" -t "$(ODL_MAIN_TAG)" -m $(MAINTAINER) -d $(DEPEND) -p $(TARGET_BUILD_PATH) @echo $(ODL_MAIN_TAG) > .odl-build.log endif diff --git a/fuel/build/opendaylight/f_odl/Makefile b/fuel/build/opendaylight/f_odl/Makefile index 6983f0c..f7ebd3e 100644 --- a/fuel/build/opendaylight/f_odl/Makefile +++ b/fuel/build/opendaylight/f_odl/Makefile @@ -36,6 +36,10 @@ clean: @rm -rf release @rm -f $(DEB_DEST)/$(DEB_NAME).deb +.PHONY: validate-cache +validate-cache: + @echo "No cache validation schema available for $(shell pwd)" + @echo "Continuing ..." .PHONY: release release:release/pool/main/$(DEB_NAME).deb |