diff options
author | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2015-03-12 15:18:06 +0100 |
---|---|---|
committer | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2015-03-17 19:17:20 +0100 |
commit | df6c1db2695030b1ba68184bac9aab9fb2d41e71 (patch) | |
tree | 2b5c57c83fdc15e23cf19ae92d0581421ebeedc8 /fuel/build/opendaylight/Makefile | |
parent | ed60ed6299ddae50e1269434adc35ce686a07e97 (diff) |
*** FIRST VERSION OF CI BUILD SCRIPT ***
- Provides build cache management to a remote location
- Provides automatic cashe repopulation
- See /fuel/ci/README
- Rebased to master
- Bug around cache handling fixed
- New option -r introduced to invoke external script/program instead of standard http(s)/fttp get and put, eg. scripts or programs to integrate with dropbox, or similar. The script needs to anheaer to curl argument list.
- Stefan Berg's comments implemented
- Fatih Degirmenci's comments implemented with one exemption: the revision state
.iso naming convention still remains the same - we need to discuss this. With
the implementation of Fatih's comments the build.sh argument structure is slightly
changed, please see ./build.sh -h
TODO:
- Further testing
- Finalize cache invalidation logic
- Make refactoring
JIRA:
Change-Id: I4efdbdd10f726c0a3229849a63040b6d2702db5c
Signed-off-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
Diffstat (limited to 'fuel/build/opendaylight/Makefile')
-rw-r--r-- | fuel/build/opendaylight/Makefile | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/fuel/build/opendaylight/Makefile b/fuel/build/opendaylight/Makefile index 9c3d22d..c112ff6 100644 --- a/fuel/build/opendaylight/Makefile +++ b/fuel/build/opendaylight/Makefile @@ -34,20 +34,42 @@ all: odl .PHONY: setup setup: - @if [ ! -d "$(TOPDIR)/f_odl" ]; then ln -s "$(realpath $(BUILD_DIR))/f_odl" "$(realpath $(TOPDIR))/f_odl"; fi + 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: odl odl: + ifeq ($(ODL_MAIN_REPO),) @echo "No config-spec target for ODL, nothing to build" else ifeq ($(shell if [ -e .odl-build.log ];then cat .odl-build.log; fi;),$(ODL_MAIN_TAG)) @cd /tmp && git clone $(ODL_MAIN_REPO) && cd /tmp/controller && git checkout $(ODL_MAIN_TAG) + @echo "ODL is up to date" else - @if [ ! -d "/tmp/controller" ]; then cd /tmp && git clone $(ODL_MAIN_REPO); fi; - @cd /tmp/controller && git checkout $(ODL_MAIN_TAG) && mvn -Dmaven.test.skip=true -gs $(MAVEN_SPEC) clean install; + @if [ ! -d "/tmp/controller" ]; then\ + cd /tmp && git clone $(ODL_MAIN_REPO);\ + fi; + + @if [ "$(UNIT_TEST)" = "FALSE" ]; then\ + echo "Building ODL without unit test";\ + cd /tmp/controller &&\ + git checkout $(ODL_MAIN_TAG) &&\ + mvn -D maven.test.skip=true -gs $(MAVEN_SPEC) clean install;\ + else\ + echo "Building ODL with unit test";\ + cd /tmp/controller &&\ + git checkout $(ODL_MAIN_TAG) &&\ + mvn -gs $(MAVEN_SPEC) clean install;\ + fi; + + @echo "odl" `git -C /tmp/controller show | grep commit | rev | cut -f1 -d " "` >> $(BUILD_BASE)/.versions @./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 |