Skip to content

Commit

Permalink
chore(release): simplify changelog automation (#12769)
Browse files Browse the repository at this point in the history
FTI-5842

(cherry picked from commit ed0b96d)

Co-authored-by: Zachary Hu <6426329+outsinre@users.noreply.github.com>
  • Loading branch information
team-gateway-bot and outsinre authored Mar 21, 2024
1 parent b829184 commit 03a70c4
Showing 1 changed file with 21 additions and 41 deletions.
62 changes: 21 additions & 41 deletions changelog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,35 @@ check_version:
fi

create_branch:
@git fetch
@git fetch --prune
@git submodule update --init --recursive
@git checkout -B $(BRANCH_NAME) $(ORIGIN_BRANCH)

generate:
@rm -f $(VERSION).md
@touch $(VERSION).md

@if [ -d "$(UNRELEASED_DIR)/kong" ] && [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong/*.yml)" ] ; then \
if [ -f "$(VERSION)/$(VERSION).md" ]; then \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(VERSION)/kong,$(UNRELEASED_DIR)/kong \
--title Kong \
--github-issue-repo $(OWNER_REPO) \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
else \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(UNRELEASED_DIR)/kong \
--title Kong \
--github-issue-repo $(OWNER_REPO) \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
fi \
@if [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong/*.yml)" ] || \
[ -n "$$(shopt -s nullglob; echo $(VERSION)/kong/*.yml)" ] ; then \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(VERSION)/kong,$(UNRELEASED_DIR)/kong \
--title Kong \
--github-issue-repo $(OWNER_REPO) \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
fi
@if [ -d "$(UNRELEASED_DIR)/kong-manager" ] && [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong-manager/*.yml)" ] ; then \
if [ -f "$(VERSION)/$(VERSION).md" ]; then \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(VERSION)/kong-manager,$(UNRELEASED_DIR)/kong-manager \
--title Kong-Manager \
--github-issue-repo Kong/kong-manager \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
else \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(UNRELEASED_DIR)/kong-manager \
--title Kong-Manager \
--github-issue-repo Kong/kong-manager \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
fi \
@if [ -n "$$(shopt -s nullglob; echo $(UNRELEASED_DIR)/kong-manager/*.yml)" ] || \
[ -n "$$(shopt -s nullglob; echo $(VERSION)/kong-manager/*.yml)" ] ; then \
changelog --debug=$(DEBUG) generate \
--repo-path . \
--changelog-paths $(VERSION)/kong-manager,$(UNRELEASED_DIR)/kong-manager \
--title Kong-Manager \
--github-issue-repo Kong/kong-manager \
--github-api-repo $(OWNER_REPO) \
--with-jiras \
>> $(VERSION).md; \
fi

@echo
Expand Down

0 comments on commit 03a70c4

Please sign in to comment.