Merge "Reducing the size of upgrade tarball" into stable/5.1

This commit is contained in:
Jenkins 2014-10-31 14:32:37 +00:00 committed by Gerrit Code Review
commit f9a3a4964f
7 changed files with 264 additions and 43 deletions

View File

@ -59,6 +59,17 @@ distclean: deep_clean clean-integration-test
# Common configuration file.
include $(SOURCE_DIR)/config.mk
.PHONY: current-version
current-version: $(BUILD_DIR)/current_version
$(BUILD_DIR)/current_version: $(call depv,CURRENT_VERSION)
echo $(CURRENT_VERSION) > $@
.PHONY: upgrade-versions
upgrade-versions: $(BUILD_DIR)/upgrade_versions
$(BUILD_DIR)/upgrade_versions: $(call depv,UPGRADE_VERSIONS)
echo -n > $@
$(foreach diff,$(UPGRADE_VERSIONS),echo $(diff) >> $@;)
# Macroses for make
include $(SOURCE_DIR)/rules.mk

View File

@ -26,10 +26,39 @@ PRODUCT_VERSION:=5.1.1
# but building process for current version differs from
# ones for other versions which are supposed
# to come from DEPS_DIR "as is"
CURRENT_VERSION:=$(PRODUCT_VERSION).x
# This is a space separated
# list of branches (versions) except current branch
UPGRADE_VERSIONS?=5.0.x
CURRENT_VERSION:=$(PRODUCT_VERSION)
# This variable is used for building diff repos.
# If it is not set then diff repo will not be built.
# If it is set then diff $(BASE_VERSION)->$(CURRENT_VERSION)
BASE_VERSION:=5.1
# UPGRADE_VERSIONS?=\
# 6.0:5.1 \
# 5.1 \
# 5.0.3:5.0
#
# It means we need to put into a tarball
#
# 0) 5.1 -> 6.0 diff mirror and other 6.0 files
# 1) 5.1 full mirror and other 5.1 files
# 2) 5.0 -> 5.0.3 diff mirror and other 5.0.3 files
#
# * It is prohibited to have multiple bundles for
# a particular version. E.g. 6.0 bundle can be one of
# ** 6.0 full bundle
# ** X.Y.Z -> 6.0 diff bundle
#
# * If a key (version before colon) is
# the same as $(CURRENT_VERSION) then
# a mirror (full or diff) will be built.
#
# * If a key does not match $(CURRENT_VERSION) then
# a mirror (full or diff) is supposed to be
# available as an artifact from a previous build job.
#
UPGRADE_VERSIONS?=\
$(CURRENT_VERSION):5.1
# Path to pre-built artifacts
DEPS_DIR_CURRENT?=$(DEPS_DIR)/$(CURRENT_VERSION)
@ -40,11 +69,15 @@ ISO_NAME?=fuel-$(PRODUCT_VERSION)
UPGRADE_TARBALL_NAME?=fuel-$(PRODUCT_VERSION)-upgrade
OPENSTACK_PATCH_TARBALL_NAME?=fuel-$(PRODUCT_VERSION)-patch
VBOX_SCRIPTS_NAME?=vbox-scripts-$(PRODUCT_VERSION)
BOOTSTARP_ART_NAME?=bootstrap.tar.gz
BOOTSTRAP_ART_NAME?=bootstrap.tar.gz
DOCKER_ART_NAME?=fuel-images.tar.lrz
VERSION_YAML_ART_NAME?=version.yaml
CENTOS_REPO_ART_NAME?=centos-repo.tar
UBUNTU_REPO_ART_NAME?=ubuntu-repo.tar
# actual name for a diff repo will be
# $(DIFF_CENTOS_REPO_ART_BASE)-NEWVERSION-OLDVERSION.tar
DIFF_CENTOS_REPO_ART_BASE?=diff-centos-repo
DIFF_UBUNTU_REPO_ART_BASE?=diff-ubuntu-repo
PUPPET_ART_NAME?=puppet.tgz
OPENSTACK_YAML_ART_NAME?=openstack.yaml
@ -123,7 +156,8 @@ LOCAL_MIRROR_UBUNTU:=$(LOCAL_MIRROR)/ubuntu
LOCAL_MIRROR_UBUNTU_OS_BASEURL:=$(LOCAL_MIRROR_UBUNTU)
LOCAL_MIRROR_DOCKER:=$(LOCAL_MIRROR)/docker
LOCAL_MIRROR_DOCKER_BASEURL:=$(LOCAL_MIRROR_DOCKER)
DIFF_MIRROR_CENTOS_BASE:=$(LOCAL_MIRROR)/centos_updates
DIFF_MIRROR_UBUNTU_BASE:=$(LOCAL_MIRROR)/ubuntu_updates
# Use download.mirantis.com mirror by default. Other possible values are
# 'msk', 'srt', 'usa', 'hrk'.

View File

@ -19,6 +19,7 @@ $(ARTS_DIR)/$(VERSION_YAML_ART_NAME): $(ISOROOT)/$(VERSION_YAML_ART_NAME)
$(ISOROOT)/$(VERSION_YAML_ART_NAME): $(call depv,PRODUCT_VERSION)
$(ISOROOT)/$(VERSION_YAML_ART_NAME): $(call depv,FEATURE_GROUPS)
$(ISOROOT)/$(VERSION_YAML_ART_NAME): $(BUILD_DIR)/repos/repos.done
mkdir -p $(@D)
echo "VERSION:" > $@
echo " feature_groups:" >> $@
$(foreach group,$(FEATURE_GROUPS),echo " - $(group)" >> $@;)
@ -34,7 +35,7 @@ endif
cat $(BUILD_DIR)/repos/version.yaml >> $@
########################
# CENTOS ARTIFACT
# CENTOS MIRROR ARTIFACT
########################
centos-repo: $(ARTS_DIR)/$(CENTOS_REPO_ART_NAME)
@ -68,7 +69,7 @@ endif
########################
# UBUNTU ARTIFACT
# UBUNTU MIRROR ARTIFACT
########################
ubuntu-repo: $(ARTS_DIR)/$(UBUNTU_REPO_ART_NAME)

28
mirror/create_diff_mirrors.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
NEWER=$1
OLDER=$2
DIFF=$3
# we need to check if OLDER dir exists
# if not, nothing to compare return exit 1
test -d ${OLDER} || { echo "${OLDER} path doesn't exist, nothing to compare"; exit 1; }
test -d ${DIFF} || mkdir -p ${DIFF}
function copy_by_checksum (){
# compare files by checksum
CHECKSUM1=$(md5sum -- $1 | awk '{print $1}')
CHECKSUM2=$(md5sum -- $2 | awk '{print $1}')
# if checksum is different then copy
[ $CHECKSUM1 = $CHECKSUM2 ] || cp -av $1 $3
}
export -f copy_by_checksum
# if file doesn't exists in old, then copy it to diff
# else compare by checksum
find ${NEWER} -type f -printf "%f\n" | xargs -i bash -c "test -f ${OLDER}/{} \
&& copy_by_checksum ${NEWER}/{} ${OLDER}/{} ${DIFF} \
|| cp -av ${NEWER}/{} ${DIFF}/{}"

View File

@ -0,0 +1,108 @@
#############################
# CENTOS DIFF MIRROR ARTIFACT
#############################
ifneq ($(BASE_VERSION),)
.PHONY: centos-diff-repo
DIFF_CENTOS_REPO_ART_NAME:=$(DIFF_CENTOS_REPO_ART_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION).tar
centos-diff-repo: $(ARTS_DIR)/$(DIFF_CENTOS_REPO_ART_NAME)
$(ARTS_DIR)/$(DIFF_CENTOS_REPO_ART_NAME): $(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME)
$(ACTION.COPY)
DIFF_CENTOS_REPO_DEP_FILE:=$(call find-files,$(DEPS_DIR_CURRENT)/$(DIFF_CENTOS_REPO_ART_NAME))
ifneq ($(DIFF_CENTOS_REPO_DEP_FILE),)
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): $(DIFF_CENTOS_REPO_DEP_FILE)
$(ACTION.COPY)
else
.DELETE_ON_ERROR: $(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME)
CURRENT_CENTOS_REPO_DEP_FILE:=$(call find-files,$(DEPS_DIR_CURRENT)/$(CENTOS_REPO_ART_NAME))
ifneq ($(CURRENT_CENTOS_REPO_DEP_FILE),)
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): CURDIR=$(BUILD_DIR)/mirror/$(CURRENT_VERSION)/centos-repo/Packages
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): $(BUILD_DIR)/mirror/centos_repo_current.done
$(BUILD_DIR)/mirror/centos_repo_current.done: $(CURRENT_CENTOS_REPO_DEP_FILE)
mkdir -p $(BUILD_DIR)/mirror/$(CURRENT_VERSION)
tar xf $(CURRENT_CENTOS_REPO_DEP_FILE) -C $(BUILD_DIR)/mirror/$(CURRENT_VERSION)
$(ACTION.TOUCH)
else
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): CURDIR=$(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): $(BUILD_DIR)/mirror/centos_repo_current.done
$(BUILD_DIR)/mirror/centos_repo_current.done: \
$(BUILD_DIR)/mirror/build.done \
$(BUILD_DIR)/packages/build.done \
$(BUILD_DIR)/openstack/build.done
$(ACTION.TOUCH)
endif
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): BASEDIR=$(BUILD_DIR)/mirror/$(BASE_VERSION)/centos-repo/Packages
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): DIFFDIR=$(DIFF_MIRROR_CENTOS_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION)/os/$(CENTOS_ARCH)/Packages
$(BUILD_DIR)/mirror/$(DIFF_CENTOS_REPO_ART_NAME): | $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml
# unpacking old version centos mirror
mkdir -p $(BUILD_DIR)/mirror/$(BASE_VERSION)
tar xf $(DEPS_DIR)/$(BASE_VERSION)/$(CENTOS_REPO_ART_NAME) -C $(BUILD_DIR)/mirror/$(BASE_VERSION)
# copying packages which differ from those in base version
mkdir -p $(DIFFDIR)
/bin/bash $(SOURCE_DIR)/mirror/create_diff_mirrors.sh $(CURDIR) $(BASEDIR) $(DIFFDIR)
# creating diff mirror
cp $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/comps.xml $(DIFFDIR)/../comps.xml
createrepo -g $(DIFFDIR)/../comps.xml -o $(DIFFDIR)/../ $(DIFFDIR)/../
rpm -qi -p $(DIFFDIR)/*.rpm | $(SOURCE_DIR)/iso/pkg-versions.awk > $(DIFF_MIRROR_CENTOS_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION)/centos-versions.yaml
tar cf $@ -C $(DIFF_MIRROR_CENTOS_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION) --xform s:^:centos_updates-$(CURRENT_VERSION)-$(BASE_VERSION)/: .
endif # ifneq ($(DIFF_CENTOS_REPO_DEP_FILE),)
endif # ifneq ($(BASE_VERSION),)
#############################
# UBUNTU DIFF MIRROR ARTIFACT
#############################
ifneq ($(BASE_VERSION),)
.PHONY: ubuntu-diff-repo
DIFF_UBUNTU_REPO_ART_NAME:=$(DIFF_UBUNTU_REPO_ART_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION).tar
ubuntu-diff-repo: $(ARTS_DIR)/$(DIFF_UBUNTU_REPO_ART_NAME)
$(ARTS_DIR)/$(DIFF_UBUNTU_REPO_ART_NAME): $(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME)
$(ACTION.COPY)
DIFF_UBUNTU_REPO_DEP_FILE:=$(call find-files,$(DEPS_DIR_CURRENT)/$(DIFF_UBUNTU_REPO_ART_NAME))
ifneq ($(DIFF_UBUNTU_REPO_DEP_FILE),)
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): $(DIFF_UBUNTU_REPO_DEP_FILE)
$(ACTION.COPY)
else
.DELETE_ON_ERROR: $(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME)
CURRENT_UBUNTU_REPO_DEP_FILE:=$(call find-files,$(DEPS_DIR_CURRENT)/$(UBUNTU_REPO_ART_NAME))
ifneq ($(CURRENT_UBUNTU_REPO_DEP_FILE),)
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): CURDIR=$(BUILD_DIR)/mirror/$(CURRENT_VERSION)/ubuntu-repo/pool/main
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): $(BUILD_DIR)/mirror/ubuntu_repo_current.done
$(BUILD_DIR)/mirror/ubuntu_repo_current.done: $(CURRENT_UBUNTU_REPO_DEP_FILE)
mkdir -p $(BUILD_DIR)/mirror/$(CURRENT_VERSION)
tar xf $(CURRENT_UBUNTU_REPO_DEP_FILE) -C $(BUILD_DIR)/mirror/$(CURRENT_VERSION)
$(ACTION.TOUCH)
else
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): CURDIR=$(LOCAL_MIRROR_UBUNTU_OS_BASEURL)/pool/main
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): $(BUILD_DIR)/mirror/ubuntu_repo_current.done
$(BUILD_DIR)/mirror/ubuntu_repo_current.done: \
$(BUILD_DIR)/mirror/build.done \
$(BUILD_DIR)/packages/build.done \
$(BUILD_DIR)/openstack/build.done
$(ACTION.TOUCH)
endif
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): BASEDIR=$(BUILD_DIR)/mirror/$(BASE_VERSION)/ubuntu-repo/pool/main
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME): DIFFDIR=$(DIFF_MIRROR_UBUNTU_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION)/pool/main
$(BUILD_DIR)/mirror/$(DIFF_UBUNTU_REPO_ART_NAME):
# unpacking old version ubuntu mirror
mkdir -p $(BUILD_DIR)/mirror/$(BASE_VERSION)
tar xf $(DEPS_DIR)/$(BASE_VERSION)/$(UBUNTU_REPO_ART_NAME) -C $(BUILD_DIR)/mirror/$(BASE_VERSION)
# copying packages which differ from those in old version
mkdir -p $(DIFFDIR)
/bin/bash $(SOURCE_DIR)/mirror/create_diff_mirrors.sh $(CURDIR) $(BASEDIR) $(DIFFDIR)
# creating diff mirror
dpkg-scanpackages -m $(DIFFDIR) > $(DIFFDIR)/../Packages
gzip -9c $(DIFFDIR)/../Packages > $(DIFFDIR)/../Packages.gz
cat $(DIFFDIR)/../Packages | $(SOURCE_DIR)/iso/pkg-versions.awk > $(DIFF_MIRROR_UBUNTU_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION)/ubuntu-versions.yaml
tar cf $@ -C $(DIFF_MIRROR_UBUNTU_BASE)-$(CURRENT_VERSION)-$(BASE_VERSION) --xform s:^:ubuntu_updates-$(CURRENT_VERSION)-$(BASE_VERSION)/: .
endif # ifneq ($(DIFF_UBUNTU_REPO_DEP_FILE),)
endif # ifneq ($(BASE_VERSION),)

View File

@ -10,6 +10,7 @@ clean-mirror: clean-ubuntu
include $(SOURCE_DIR)/mirror/centos/module.mk
include $(SOURCE_DIR)/mirror/ubuntu/module.mk
include $(SOURCE_DIR)/mirror/docker/module.mk
include $(SOURCE_DIR)/mirror/diff_mirror_module.mk
$(BUILD_DIR)/mirror/build.done: \
$(BUILD_DIR)/mirror/centos/build.done \

View File

@ -17,7 +17,7 @@ upgrade-lrzip: $(UPGRADE_TARBALL_PATH).lrz
# UPGRADE ARTIFACT
########################
$(UPGRADE_TARBALL_PATH): \
$(BUILD_DIR)/upgrade/openstack-part.tar \
$(BUILD_DIR)/upgrade/openstack-part.done \
$(BUILD_DIR)/upgrade/fuel-part.tar \
$(BUILD_DIR)/upgrade/common-part.tar
mkdir -p $(@D)
@ -29,7 +29,7 @@ $(UPGRADE_TARBALL_PATH): \
# UPGRADE LRZIP ARTIFACT
########################
$(UPGRADE_TARBALL_PATH).lrz: \
$(BUILD_DIR)/upgrade/openstack-part.tar \
$(BUILD_DIR)/upgrade/openstack-part.done \
$(BUILD_DIR)/upgrade/fuel-lrzip-part.tar \
$(BUILD_DIR)/upgrade/common-part.tar
mkdir -p $(@D)
@ -83,7 +83,7 @@ $(BUILD_DIR)/upgrade/common-part.tar: \
$(BUILD_DIR)/upgrade/fuel-part.tar: \
$(BUILD_DIR)/bootstrap/build.done \
$(ISOROOT)/version.yaml \
$(BUILD_DIR)/docker/fuel-images.tar.lrz
$(BUILD_DIR)/docker/build.done
mkdir -p $(@D)
rm -f $@
tar cf $@ -C $(BUILD_DIR)/docker --xform s:^:upgrade/images/: fuel-images.tar.lrz
@ -96,7 +96,7 @@ $(BUILD_DIR)/upgrade/fuel-part.tar: \
$(BUILD_DIR)/upgrade/fuel-lrzip-part.tar: \
$(BUILD_DIR)/bootstrap/build.done \
$(ISOROOT)/version.yaml \
$(BUILD_DIR)/docker/fuel-images.tar.lrz
$(BUILD_DIR)/docker/build.done
mkdir -p $(@D)
rm -f $@
mkdir -p $(BUILD_DIR)/upgrade/images
@ -108,8 +108,10 @@ $(BUILD_DIR)/upgrade/fuel-lrzip-part.tar: \
########################
# OPENSTACK PART
########################
define build_openstack_part
# 1 - new vervion
# 2 - old version
define openstack-version-part
ifeq ($(CURRENT_VERSION),$1)
ARTS_DIR_$1:=$(ARTS_DIR)
else
@ -119,32 +121,73 @@ endif
$(BUILD_DIR)/upgrade/openstack_version_$1: $$(ARTS_DIR_$1)/$(OPENSTACK_YAML_ART_NAME)
python -c "import yaml; print filter(lambda r: r['fields'].get('name'), yaml.load(open('$$(ARTS_DIR_$1)/$(OPENSTACK_YAML_ART_NAME)')))[0]['fields']['version']" > $$@
$(BUILD_DIR)/upgrade/openstack-part.tar: $(BUILD_DIR)/upgrade/openstack-$1-part.tar
.DELETE_ON_ERROR: $(BUILD_DIR)/upgrade/openstack-$1-part.tar
ifneq ($2,)
CENTOS_REPO_ART:=$(DIFF_CENTOS_REPO_ART_BASE)-$1-$2.tar
CENTOS_REPO_ART_TOPDIR:=centos_updates-$1-$2
UBUNTU_REPO_ART:=$(DIFF_UBUNTU_REPO_ART_BASE)-$1-$2.tar
UBUNTU_REPO_ART_TOPDIR:=ubuntu_updates-$1-$2
$(BUILD_DIR)/upgrade/openstack_version_$2: $(DEPS_DIR)/$2/$(OPENSTACK_YAML_ART_NAME)
python -c "import yaml; print filter(lambda r: r['fields'].get('name'), yaml.load(open('$(DEPS_DIR)/$2/$(OPENSTACK_YAML_ART_NAME)')))[0]['fields']['version']" > $$@
else
CENTOS_REPO_ART:=$(CENTOS_REPO_ART_NAME)
CENTOS_REPO_ART_TOPDIR:=centos-repo
UBUNTU_REPO_ART:=$(UBUNTU_REPO_ART_NAME)
UBUNTU_REPO_ART_TOPDIR:=ubuntu-repo
endif
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: BASE=$(BUILD_DIR)/upgrade/openstack-$1-part
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: OPENSTACK_VERSION=$$(shell cat $(BUILD_DIR)/upgrade/openstack_version_$1)
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: CENTOS_BASE=$$(BASE)/upgrade/repos/$$(OPENSTACK_VERSION)/centos/x86_64
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: UBUNTU_BASE=$$(BASE)/upgrade/repos/$$(OPENSTACK_VERSION)/ubuntu/x86_64
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: PUPPET_BASE=$$(BASE)/upgrade/puppet/$$(OPENSTACK_VERSION)
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: RELEASES_BASE=$$(BASE)/upgrade/releases
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: RELEASE_VERSIONS_BASE=$$(BASE)/upgrade/release_versions
$(BUILD_DIR)/upgrade/openstack-$1-part.tar: \
CENTOS_REPO_ART_DEP_FILE:=$$(call find-files,$(DEPS_DIR)/$1/$$(CENTOS_REPO_ART))
UBUNTU_REPO_ART_DEP_FILE:=$$(call find-files,$(DEPS_DIR)/$1/$$(UBUNTU_REPO_ART))
$(BUILD_DIR)/upgrade/openstack-part.done: $(BUILD_DIR)/upgrade/openstack-$1-part.done
.DELETE_ON_ERROR: $(BUILD_DIR)/upgrade/openstack-part.tar
$(BUILD_DIR)/upgrade/openstack-$1-part.done: BASE=$(BUILD_DIR)/upgrade/openstack-$1-part
$(BUILD_DIR)/upgrade/openstack-$1-part.done: OPENSTACK_VERSION=$$(shell cat $(BUILD_DIR)/upgrade/openstack_version_$1)
ifneq ($2,)
$(BUILD_DIR)/upgrade/openstack-$1-part.done: $(BUILD_DIR)/upgrade/openstack_version_$2
endif
$(BUILD_DIR)/upgrade/openstack-$1-part.done: CENTOS_BASE=$$(BASE)/upgrade/repos/$$(OPENSTACK_VERSION)/centos/x86_64
$(BUILD_DIR)/upgrade/openstack-$1-part.done: UBUNTU_BASE=$$(BASE)/upgrade/repos/$$(OPENSTACK_VERSION)/ubuntu/x86_64
$(BUILD_DIR)/upgrade/openstack-$1-part.done: PUPPET_BASE=$$(BASE)/upgrade/puppet/$$(OPENSTACK_VERSION)
$(BUILD_DIR)/upgrade/openstack-$1-part.done: RELEASES_BASE=$$(BASE)/upgrade/releases
$(BUILD_DIR)/upgrade/openstack-$1-part.done: RELEASE_VERSIONS_BASE=$$(BASE)/upgrade/release_versions
ifneq ($$(CENTOS_REPO_ART_DEP_FILE),)
$(BUILD_DIR)/upgrade/openstack-$1-part.done: $$(CENTOS_REPO_ART_DEP_FILE)
else
$(BUILD_DIR)/upgrade/openstack-$1-part.done: $$(ARTS_DIR_$1)/$$(CENTOS_REPO_ART)
endif
ifneq ($$(UBUNTU_REPO_ART_DEP_FILE),)
$(BUILD_DIR)/upgrade/openstack-$1-part.done: $$(UBUNTU_REPO_ART_DEP_FILE)
else
$(BUILD_DIR)/upgrade/openstack-$1-part.done: $$(ARTS_DIR_$1)/$$(UBUNTU_REPO_ART)
endif
$(BUILD_DIR)/upgrade/openstack-$1-part.done: \
$(BUILD_DIR)/upgrade/openstack_version_$1 \
$$(ARTS_DIR_$1)/$(OPENSTACK_YAML_ART_NAME) \
$$(ARTS_DIR_$1)/$(VERSION_YAML_ART_NAME) \
$$(ARTS_DIR_$1)/$(CENTOS_REPO_ART_NAME) \
$$(ARTS_DIR_$1)/$(UBUNTU_REPO_ART_NAME) \
$$(ARTS_DIR_$1)/$(PUPPET_ART_NAME)
rm -f $$@
mkdir -p $$(@D)
# CENTOS REPO
mkdir -p $$(CENTOS_BASE)
tar xf $$(ARTS_DIR_$1)/$(CENTOS_REPO_ART_NAME) -C $$(CENTOS_BASE) --xform s:^centos-repo/::
ifneq ($$(CENTOS_REPO_ART_DEP_FILE),)
tar xf $$(CENTOS_REPO_ART_DEP_FILE) -C $$(CENTOS_BASE) --xform s:^$$(CENTOS_REPO_ART_TOPDIR)/::
else
tar xf $$(ARTS_DIR_$1)/$$(CENTOS_REPO_ART) -C $$(CENTOS_BASE) --xform s:^$$(CENTOS_REPO_ART_TOPDIR)/::
endif
# UBUNTU REPO
mkdir -p $$(UBUNTU_BASE)
tar xf $$(ARTS_DIR_$1)/$(UBUNTU_REPO_ART_NAME) -C $$(UBUNTU_BASE) --xform s:^ubuntu-repo/::
ifneq ($$(UBUNTU_REPO_ART_DEP_FILE),)
tar xf $$(UBUNTU_REPO_ART_DEP_FILE) -C $$(UBUNTU_BASE) --xform s:^$$(UBUNTU_REPO_ART_TOPDIR)/::
else
tar xf $$(ARTS_DIR_$1)/$$(UBUNTU_REPO_ART) -C $$(UBUNTU_BASE) --xform s:^$$(UBUNTU_REPO_ART_TOPDIR)/::
endif
# PUPPET MODULES
mkdir -p $$(PUPPET_BASE)/modules
tar zxf $$(ARTS_DIR_$1)/$(PUPPET_ART_NAME) -C $$(PUPPET_BASE)/modules --xform s:^puppet/::
@ -156,26 +199,21 @@ $(BUILD_DIR)/upgrade/openstack-$1-part.tar: \
# OPENSTACK-YAML
mkdir -p $$(RELEASES_BASE)
cp $$(ARTS_DIR_$1)/$(OPENSTACK_YAML_ART_NAME) $$(RELEASES_BASE)/$$(OPENSTACK_VERSION).yaml
# METADATA-YAML
test -e $$(RELEASES_BASE)/metadata.yaml || echo "diff_releases:" > $$(RELEASES_BASE)/metadata.yaml
ifneq ($2,)
echo " $$(OPENSTACK_VERSION): $$(shell cat $(BUILD_DIR)/upgrade/openstack_version_$2)" >> $$(RELEASES_BASE)/metadata.yaml
endif
# VERSION-YAML
mkdir -p $$(RELEASE_VERSIONS_BASE)
cp $$(ARTS_DIR_$1)/$(VERSION_YAML_ART_NAME) $$(RELEASE_VERSIONS_BASE)/$$(OPENSTACK_VERSION).yaml
# ARCHIVING
tar cf $$@ -C $$(BASE) .
tar rf $(BUILD_DIR)/upgrade/openstack-part.tar -C $$(BASE) .
@mkdir -p $$(@D)
touch $$@
endef
$(foreach version,$(CURRENT_VERSION) $(UPGRADE_VERSIONS),$(eval $(call openstack-version-part,$(version))))
$(foreach diff,$(UPGRADE_VERSIONS),$(eval $(call build_openstack_part,$(shell echo $(diff) | awk -F':' '{print $$1}'),$(shell echo $(diff) | awk -F':' '{print $$2}'))))
# ===========================
# ALL VERSIONS IN ONE ARCHIVE
# ===========================
$(BUILD_DIR)/upgrade/openstack-part.tar: \
$(BUILD_DIR)/upgrade/openstack-$(CURRENT_VERSION)-part.tar
# Workaround for puppet issue in 5.0 and 5.0.1 releases:
tar cf $@ -C $(SOURCE_DIR) upgrade/config/5.0/*
tar rf $@ -C $(SOURCE_DIR) upgrade/config/5.0.1/*
# Packing current version
tar Af $@ $(BUILD_DIR)/upgrade/openstack-$(CURRENT_VERSION)-part.tar
# Packing all upgrade versions
# They are already built because we added them
# as dependencies for this target before in openstack-version-part define
$(foreach version,$(UPGRADE_VERSIONS),tar Af $@ $(BUILD_DIR)/upgrade/openstack-$(version)-part.tar;)
$(BUILD_DIR)/upgrade/openstack-part.done:
$(ACTION.TOUCH)