Do checkout of the code when preparing repo target

If GERRIT_BRANCH is defined, checkout fetch_head
instead of cherry-picking it.

Closes-bug: #1455156
partial blueprint: package-fuel-components

Change-Id: I6f57bd3a930842bdcc6f313fde04ee98cba7b01a
This commit is contained in:
Vladimir Kuklin 2015-05-14 20:03:29 +03:00
parent 1c03fb884d
commit db6d10b407
1 changed files with 9 additions and 0 deletions

View File

@ -21,10 +21,19 @@ $(BUILD_DIR)/repos/$1.done:
#Clone everything and checkout to branch (or hash)
git clone $2 $(BUILD_DIR)/repos/$1 && (cd $(BUILD_DIR)/repos/$1 && git checkout -q $3)
ifeq ($(strip $(GERRIT_BRANCH)),)
# Pull gerrit commits if given
$(foreach var,$(filter-out none,$5),
( cd $(BUILD_DIR)/repos/$1 && git fetch $4 $(var) && git cherry-pick FETCH_HEAD ) ;
)
#FIXME(aglarendil): THIS IS A TEMPORARY FIX TO CHECK OUT CODE FOR PACKAGE BUILDING IN CI
#IT SHOULD BE REPLACED WITH ANOTHER APPROACH SOON
else
$(foreach var,$(filter-out none,$5),
( cd $(BUILD_DIR)/repos/$1 && git fetch $4 $(var) && git checkout FETCH_HEAD ) ;
)
endif
touch $$@
endef