diff --git a/Makefile b/Makefile index a015b5a..b5980da 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,14 @@ endif BUILD_TARGETS := build install BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)' +# Update changelog vars +ifneq (,$(SINCE_TAG)) + sinceTag := --since-tag $(SINCE_TAG) +endif +ifneq (,$(UPCOMING_TAG)) + upcomingTag := --future-release $(UPCOMING_TAG) +endif + all: build install build: BUILD_ARGS := $(build_args) -o $(BUILDDIR) @@ -55,3 +63,11 @@ test-e2e: mock-gen: mkdir -p $(MOCKS_DIR) $(MOCKGEN_CMD) -source=clientcontroller/interface.go -package mocks -destination $(MOCKS_DIR)/babylon.go + +.PHONY: mock-gen + +update-changelog: + @echo ./scripts/update_changelog.sh $(sinceTag) $(upcomingTag) + ./scripts/update_changelog.sh $(sinceTag) $(upcomingTag) + +.PHONY: update-changelog diff --git a/scripts/update_changelog.sh b/scripts/update_changelog.sh index 5887564..cb35c5c 100755 --- a/scripts/update_changelog.sh +++ b/scripts/update_changelog.sh @@ -12,12 +12,12 @@ OPTS=$(getopt -l "help,release-branch:,since-tag:,future-release:,full,token:" - function print_usage() { echo -e "Usage: $0 [-h|--help] [-f|--full] [--release-branch ] [--since-tag ] [--future-release] [-t|--token ] --h, --help Display help --f, --full Process changes since the beginning (by default: since latest git version tag) ---since-tag Process changes since git version tag (by default: since latest git version tag) ---future-release Put the unreleased changes in the specified +-h, --help Display help. +-f, --full Process changes since the beginning (by default: since latest git version tag). +--since-tag Process changes since git version tag (by default: since latest git version tag). +--future-release Put the unreleased changes in the specified . --release-branch Limit pull requests to the release branch . ---token Pass changelog github token " +--token Pass changelog github token ." } function remove_opt() {