Align fuel packages version schema with perestroika
Fuel packages should be aligned to the same versioning schema as we have in perestroika and specs [1] [1] https://github.com/openstack/fuel-specs/blob/master/specs/ \ 8.0/separate-mos-from-centos.rst Closes-bug: #1524758 Change-Id: I1b5bd2617b6d388b2c4852d5f74ae3adf84f8991
This commit is contained in:
parent
7e850e85d2
commit
7702258023
|
@ -44,8 +44,8 @@ $(BUILD_DIR)/packages/deb/$1.done: $(BUILD_DIR)/repos/repos.done
|
|||
|
||||
DEBFULLNAME=`awk -F'=' '/DEBFULLNAME/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
DEBEMAIL=`awk -F'=' '/DEBEMAIL/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
sudo -E dch -c $$(SANDBOX_UBUNTU)/tmp/$1/debian/changelog -b --force-distribution \
|
||||
-v $(PACKAGE_VERSION)-`awk -F'=' '/RELEASE/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
sudo -E dch -c $$(SANDBOX_UBUNTU)/tmp/$1/debian/changelog -D $(UBUNTU_RELEASE) -b --force-distribution \
|
||||
-v $(PACKAGE_VERSION)-`awk -F'=' '/DEBRELEASE/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version` \
|
||||
"`awk -F'=' '/DEBMSG/ {print $$$$2}' $(BUILD_DIR)/packages/sources/$1/version`"
|
||||
dpkg-checkbuilddeps $(BUILD_DIR)/repos/$1/debian/control 2>&1 | sed 's/^dpkg-checkbuilddeps: Unmet build dependencies: //g' | sed 's/([^()]*)//g;s/|//g' | sudo tee $$(SANDBOX_UBUNTU)/tmp/$1.installdeps
|
||||
sudo chroot $$(SANDBOX_UBUNTU) /bin/sh -c "cat /tmp/$1.installdeps | xargs --no-run-if-empty apt-get -y install"
|
||||
|
|
|
@ -14,33 +14,31 @@ $(BUILD_DIR)/packages/sources/$1/$2: $(call find-files,$3)
|
|||
cp $3 $(BUILD_DIR)/packages/sources/$1/$2
|
||||
endef
|
||||
|
||||
# Prepare sources + version file in format:
|
||||
# Prepare sources + rpm_changelog + version file in format:
|
||||
#
|
||||
# VERSION=$(PRODUCT_VERSION)
|
||||
# if gerrit commit is given then
|
||||
# RELEASE=${commit_num}.0.gerrit${request_number}.${patchset_number}.git${git_sha}
|
||||
# else
|
||||
# RELEASE=${commit_num}.1.git${git_sha}
|
||||
# RPMRELEASE=1.mos${commit_num}
|
||||
# DEBRELEASE=1~u14.04+mos${commit_num}
|
||||
# DEBFULLNAME=Commit Author
|
||||
# DEBEMAIL=Commit Author email address
|
||||
# DEBMSG=Commit message
|
||||
# DEBMSG={commit_sha} {Commit message}
|
||||
define prepare_git_source
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: $(BUILD_DIR)/repos/repos.done
|
||||
$(BUILD_DIR)/packages/source_$1.done: $(BUILD_DIR)/packages/sources/$1/$2
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: VERSIONFILE:=$(BUILD_DIR)/packages/sources/$1/version
|
||||
$(BUILD_DIR)/packages/sources/$1/$2: CHANGELOGFILE:=$(BUILD_DIR)/packages/sources/$1/changelog
|
||||
$(BUILD_DIR)/packages/sources/$1/$2:
|
||||
mkdir -p $(BUILD_DIR)/packages/sources/$1
|
||||
cd $3 && git archive --format tar --worktree-attributes $4 > $(BUILD_DIR)/packages/sources/$1/$1.tar
|
||||
echo VERSION=$(PACKAGE_VERSION) > $$(VERSIONFILE)
|
||||
test -z $(GERRIT_BRANCH) && echo -n RELEASE=`git -C $3 rev-list --no-merges $4 --count` >> $$(VERSIONFILE) \
|
||||
|| echo -n RELEASE=`git -C $3 rev-list --no-merges $(GERRIT_BRANCH) --count` >> $$(VERSIONFILE)
|
||||
test -z $(GERRIT_BRANCH) && echo -n ".1" >> $$(VERSIONFILE) \
|
||||
|| echo -n ".2.gerrit"`echo $5 | sed 's].*\/.*\/\(.*\/.*\)]\1]' | sed 's/\//./'` >> $$(VERSIONFILE)
|
||||
test -z $(GERRIT_BRANCH) && echo ".git`git -C $3 rev-parse --short $4`" >> $$(VERSIONFILE) \
|
||||
|| echo ".git`git -C $3 rev-parse --short $(GERRIT_BRANCH)`" >> $$(VERSIONFILE)
|
||||
echo RPMRELEASE=1.mos`git -C $3 rev-list --no-merges $4 --count` >> $$(VERSIONFILE)
|
||||
echo "%changelog\n* `LC_TIME=C date +\"%a %b %d %Y\"` `git -C $3 log -1 --pretty=format:%an` \
|
||||
<`git -C $3 log -1 --pretty=format:%ae`> - $(PACKAGE_VERSION)-1.mos`git -C $3 rev-list --no-merges $4 --count`\n-\
|
||||
`git rev-parse --short HEAD` `git -C $3 log -1 --pretty=%s`" > $$(CHANGELOGFILE)
|
||||
echo DEBRELEASE=1~u14.04+`git -C $3 rev-list --no-merges $4 --count` >> $$(VERSIONFILE)
|
||||
echo DEBFULLNAME=`git -C $3 log -1 --pretty=format:%an` >> $$(VERSIONFILE)
|
||||
echo DEBEMAIL=`git -C $3 log -1 --pretty=format:%ae` >> $$(VERSIONFILE)
|
||||
echo DEBMSG=`git -C $3 log -1 --pretty=%s` >> $$(VERSIONFILE)
|
||||
echo DEBMSG=`git rev-parse --short HEAD` `git -C $3 log -1 --pretty=%s` >> $$(VERSIONFILE)
|
||||
cd $(BUILD_DIR)/packages/sources/$1 && tar -rf $1.tar version
|
||||
cd $(BUILD_DIR)/packages/sources/$1 && gzip -9 $1.tar && mv $1.tar.gz $2
|
||||
endef
|
||||
|
|
|
@ -57,11 +57,12 @@ $(BUILD_DIR)/packages/rpm/$1.done:
|
|||
sudo mount --bind /dev $$(SANDBOX)/dev && \
|
||||
sudo mount --bind $$(LOCAL_MIRROR) $$(SANDBOX)/mirrors && \
|
||||
mkdir -p $$(SANDBOX)/tmp/SOURCES && \
|
||||
sudo cp -r $(BUILD_DIR)/packages/sources/$1/* $$(SANDBOX)/tmp/SOURCES && \
|
||||
sudo cp -r $(BUILD_DIR)/packages/sources/$1/* $$(SANDBOX)/tmp/SOURCES
|
||||
-test -f $(BUILD_DIR)/packages/sources/$1/changelog && cat $(BUILD_DIR)/packages/sources/$1/changelog >> $$(SPECFILE)
|
||||
sudo cp $$(SPECFILE) $$(SANDBOX)/tmp && \
|
||||
sudo chroot $$(SANDBOX) yum-builddep -y /tmp/$1.spec
|
||||
test -f $$(SANDBOX)/tmp/SOURCES/version && \
|
||||
sudo chroot $$(SANDBOX) rpmbuild --nodeps --define "_topdir /tmp" --define "release `awk -F'=' '/RELEASE/ {print $$$$2}' $$(SANDBOX)/tmp/SOURCES/version`" -ba /tmp/$1.spec || \
|
||||
sudo chroot $$(SANDBOX) rpmbuild --nodeps --define "_topdir /tmp" --define "release `awk -F'=' '/RPMRELEASE/ {print $$$$2}' $$(SANDBOX)/tmp/SOURCES/version`" -ba /tmp/$1.spec || \
|
||||
sudo chroot $$(SANDBOX) rpmbuild --nodeps --define "_topdir /tmp" -ba /tmp/$1.spec
|
||||
cp $$(SANDBOX)/tmp/RPMS/*/*.rpm $(BUILD_DIR)/packages/rpm/RPMS/x86_64
|
||||
sudo sh -c "$$$${SANDBOX_DOWN}"
|
||||
|
|
9
repos.mk
9
repos.mk
|
@ -21,19 +21,10 @@ $(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
|
||||
|
||||
|
|
Loading…
Reference in New Issue