From b8eaa3c1038e2b9ba12cb4895c00a9a9d91acc15 Mon Sep 17 00:00:00 2001 From: "Tan, Yew Wayne" Date: Thu, 9 May 2019 14:34:21 +0800 Subject: [PATCH] ltsutils: make lts-koji: Modify koji target for building on LTS infrastructure Differences: - Restrict to submit from an active branch instead of master branch - git pull --rebase from matching remote LTS branch if available - Add "-lts" suffix to git tag - Assume koji buildtag name is identical to branch name Signed-off-by: Tan, Yew Wayne --- Makefile.common.lts | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Makefile.common.lts b/Makefile.common.lts index 51e9ff0..3d03bee 100644 --- a/Makefile.common.lts +++ b/Makefile.common.lts @@ -37,9 +37,9 @@ lts-build: @tag=$$(git tag --points-at); \ if [[ -z $$tag ]]; then \ echo This commit does not have a tag.; \ - echo Proceeding to run \"make koji\".; \ + echo Proceeding to run \"make lts-koji\".; \ $(LTSUTILS) prompt || exit; \ - $(MAKE) koji; \ + $(MAKE) lts-koji; \ exit; \ fi; \ older=$$($(LTSUTILS) prev-branch); \ @@ -51,9 +51,9 @@ lts-build: if [[ $$(git rev-parse $$older) != $$(git rev-parse $$current) ]]; then \ echo Previous branch and current branch have different commits.; \ for b in $$older $$current; do echo $$b $$(git log --oneline -1 $$b); done; \ - echo Proceeding to run \"make koji\".; \ + echo Proceeding to run \"make lts-koji\".; \ $(LTSUTILS) prompt || exit; \ - $(MAKE) koji; \ + $(MAKE) lts-koji; \ exit; \ fi; \ if $(LTSUTILS) can-reuse-binary $$older; then \ @@ -61,8 +61,30 @@ lts-build: $(KOJI_CMD) tag-build $$current $(SRPMVERS); \ else \ echo Could not reuse binary from $$older.; \ - echo Proceeding to run \"make bump && make koji\".; \ + echo Proceeding to run \"make bump lts-koji\".; \ $(LTSUTILS) prompt || exit; \ - $(MAKE) bump && $(MAKE) koji; \ + $(MAKE) bump lts-koji; \ fi @$(LTSUTILS) next-branch --checkout + +#help lts-koji: Same as "koji" but for working on LTS branches. Should not +#help be called directly, use lts-build instead. +lts-koji: prekoji-checks kojidef + @$(LTSUTILS) sanity-check + @$(MAKE) spdxcheck + @$(MAKE) checkblacklist + @current=$$($(LTSUTILS) current-branch); \ + if ! grep $$current $(TOPLVL)/projects/common/lts/active-branches; then \ + echo "Error: Must be on an active branch to submit to koji" >&2; \ + exit 1; \ + fi; \ + if ! git diff --quiet HEAD ${SPECFILE}; then \ + echo "Error: All changes to ${SPECFILE} must be committed first" >&2; \ + exit 1; \ + fi; \ + if git rev-parse --verify --quiet origin/$$current > /dev/null; then \ + git pull --rebase; \ + fi + git tag $(SRPMVERS)-lts + git push origin $$($(LTSUTILS) current-branch) refs/tags/$(SRPMVERS)-lts + $(KOJI_CMD) build $$KOJI_NOWAIT $$($(LTSUTILS) current-branch) $(PKG_BASE_URL)/$(PKG_NAME)?#$(SRPMVERS)-lts