Makefile: Add PREV support for clog

When making a new release that contains commits that have already been
merged onto c10s (but not build) running make release would result in an
empty changelog.

This adds the PREV environmental variable so that the hash of the
previous release can be used as the reference for creating the clog.

eg. PREV=ACTUALHASH make release

Where ACTUALHASH is the git hash of the commit used to make the previous
release. Usually this is one commit before the first commit you want to
include in this build.

Related: RHEL-40021
This commit is contained in:
Brian C. Lane 2024-06-05 15:08:07 -07:00
parent b2e2c3d8d5
commit 1c3dbc9548

View File

@ -3,6 +3,9 @@ NAME=lorax-templates-rhel
RHELVER=10.0
RHPKG=centpkg --release=c10s
# Previous release, override this when new commits are already on c10s
PREV ?= origin/c10s
# git user.email and user.name must be setup
GITEMAIL := $(shell git config user.email)
GITNAME := $(shell git config user.name)
@ -34,7 +37,7 @@ update-spec: clog
clog:
@echo "* $(shell date '+%a %b %d %Y') ${GITNAME} <${GITEMAIL}> - ${RHELVER}-${SERIAL}" > clog-spec
./tools/git-changelog -t origin/c10s > clog
./tools/git-changelog -t ${PREV} > clog
cat clog >> clog-spec
# These need to rerun make to pick up the bumped serial number