1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00

include Git branch into RPM package release info

This commit is contained in:
Steffen Vogel 2017-04-01 23:43:46 +02:00
parent 2ad7c884f0
commit 1b987ad95c
2 changed files with 4 additions and 5 deletions

View file

@ -74,9 +74,11 @@ VERSION_NUM = $(shell VERSION=$(VERSION); echo $${VERSION:1})
ifdef CI
GIT_REV = ${CI_BUILD_REF:0:7}
VARIANT := ci~$(VARIANT)
GIT_BRANCH = ${CI_COMMIT_REF_NAME}
VARIANT := $(VARIANT)-ci
else
GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
endif

View file

@ -2,9 +2,6 @@ RPMDIR = $(BUILDDIR)/packaging/rpm
SPEC_VILLAS = $(BUILDDIR)/packaging/rpm/villas-node.spec
# Increment this number for minor release bumps
MINOR = 2
rpm: rpm-villas rpm-libwebsockets rpm-libxil
rpm-villas: $(TAR_VILLAS) $(SPEC_VILLAS) | $(RPMDIR)/SOURCES/
@ -29,7 +26,7 @@ rpm-libwebsockets: | $(RPMDIR)/RPMS $(BUILDDIR)/thirdparty/libwebsockets/
# We patch version number and release fields of the spec file based on the current Git commit
$(SPEC_VILLAS): $(SRCDIR)/packaging/rpm/villas-node.spec | $$(dir $$@)
sed -e "s/§VERSION§/$(VERSION_NUM)/g" \
-e "s/§RELEASE§/$(MINOR).$(VARIANT).$$(date +%Y%m%d)git$$(echo $(GIT_REV) | cut -b1-7)/g" < $^ > $@
-e "s/§RELEASE§/1.$(GIT_BRANCH)-$(VARIANT).$$(date +%Y%m%d)git$(GIT_REV)/g" < $^ > $@
clean-rpm:
rm -rf $(RPMDIR)