From 057c508fff24f0a8a01660f551a0b8ff4feece91 Mon Sep 17 00:00:00 2001 From: AD Date: Mon, 25 Nov 2013 11:48:54 +0200 Subject: [PATCH] Add possibility to build iso with specific nailgun/astute/ostf gerrit commits Some modifications in order to provide support for ISO build with specific nailgun/astute/ostf gerrit commits. Gerrit URLs and commits can be passed via environment variables. Change-Id: I32b78c2b850b0f7c9c5d9028cad160eeb9a3b75c --- config.mk | 11 +++++++++++ repos.mk | 15 ++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config.mk b/config.mk index 33303ed93..8b29ac8b6 100644 --- a/config.mk +++ b/config.mk @@ -49,6 +49,17 @@ NAILGUN_REPO?=https://github.com/stackforge/fuel-web.git ASTUTE_REPO?=https://github.com/stackforge/fuel-astute.git OSTF_REPO?=https://github.com/stackforge/fuel-ostf.git +# Gerrit URLs and commits +FUELLIB_GERRIT_URL?=https://review.openstack.org/stackforge/fuel-library +NAILGUN_GERRIT_URL?=https://review.openstack.org/stackforge/fuel-web +ASTUTE_GERRIT_URL?=https://review.openstack.org/stackforge/fuel-astute +OSTF_GERRIT_URL?=https://review.openstack.org/stackforge/fuel-ostf + +FUELLIB_GERRIT_COMMIT?=none +NAILGUN_GERRIT_COMMIT?=none +ASTUTE_GERRIT_COMMIT?=none +OSTF_GERRIT_COMMIT?=none + LOCAL_MIRROR_SRC:=$(LOCAL_MIRROR)/src LOCAL_MIRROR_EGGS:=$(LOCAL_MIRROR)/eggs LOCAL_MIRROR_GEMS:=$(LOCAL_MIRROR)/gems diff --git a/repos.mk b/repos.mk index 334215e0d..85ce510a8 100644 --- a/repos.mk +++ b/repos.mk @@ -15,7 +15,12 @@ $(BUILD_DIR)/repos/$1.done: # Clone repo and checkout required commit mkdir -p $(BUILD_DIR)/repos rm -rf $(BUILD_DIR)/repos/$1 - git clone --depth 1 --branch $3 $2 $(BUILD_DIR)/repos/$1 + # Clone with depth=1 if no gerrit commits given, otherwise clone everything + test "$5" = "none" && git clone --depth 1 --branch $3 $2 $(BUILD_DIR)/repos/$1 || git clone --branch $3 $2 $(BUILD_DIR)/repos/$1 + # Pull gerrit commits if given + $(foreach var,$5, + test "$(var)" = "none" || ( cd $(BUILD_DIR)/repos/$1 && git fetch $4 $(var) && git cherry-pick FETCH_HEAD ) ; + ) # Update versions.yaml touch $(BUILD_DIR)/repos/version.yaml sed -i '/^ $1_sha:/d' $(BUILD_DIR)/repos/version.yaml @@ -24,7 +29,7 @@ $(BUILD_DIR)/repos/$1.done: touch $(BUILD_DIR)/repos/$1.done endef -$(eval $(call build_repo,nailgun,$(NAILGUN_REPO),$(NAILGUN_COMMIT))) -$(eval $(call build_repo,astute,$(ASTUTE_REPO),$(ASTUTE_COMMIT))) -$(eval $(call build_repo,fuellib,$(FUELLIB_REPO),$(FUELLIB_COMMIT))) -$(eval $(call build_repo,ostf,$(OSTF_REPO),$(OSTF_COMMIT))) +$(eval $(call build_repo,nailgun,$(NAILGUN_REPO),$(NAILGUN_COMMIT),$(NAILGUN_GERRIT_URL),$(NAILGUN_GERRIT_COMMIT))) +$(eval $(call build_repo,astute,$(ASTUTE_REPO),$(ASTUTE_COMMIT),$(ASTUTE_GERRIT_URL),$(ASTUTE_GERRIT_COMMIT))) +$(eval $(call build_repo,fuellib,$(FUELLIB_REPO),$(FUELLIB_COMMIT),$(FUELLIB_GERRIT_URL),$(FUELLIB_GERRIT_COMMIT))) +$(eval $(call build_repo,ostf,$(OSTF_REPO),$(OSTF_COMMIT),$(OSTF_GERRIT_URL),$(OSTF_GERRIT_COMMIT)))