Skip to content

Commit 9ce0dcb

Browse files
authored
Merge pull request #3440 from rvacaru/3405/releasechangelog-sh-args
Introduce args in releasechangelog script
2 parents 8410cb5 + 592f5b3 commit 9ce0dcb

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ release-manifests: ## Release manifest files
572572

573573
.PHONY: release-changelog
574574
release-changelog: $(GH) ## Generates release notes using Github release notes.
575-
./hack/releasechangelog.sh > $(RELEASE_DIR)/CHANGELOG.md
575+
./hack/releasechangelog.sh -v $(VERSION) -p $(PREVIOUS_VERSION) -o $(GH_ORG_NAME) -r $(GH_REPO_NAME) -c $(CORE_CONTROLLER_PROMOTED_IMG) > $(RELEASE_DIR)/CHANGELOG.md
576576

577577
.PHONY: release-binaries
578578
release-binaries: ## Builds the binaries to publish with a release

hack/releasechangelog.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,50 @@ set -o errexit
1717
set -o nounset
1818
set -o pipefail
1919

20+
function show_help()
21+
{
22+
cat << EOF
23+
Usage: ${0##*/} -v VERSION -p PREVIOUS_VERSION -o GH_ORG_NAME -r GH_REPO_NAME -c CORE_CONTROLLER_PROMOTED_IMG
24+
25+
This generates the release notes for the new CAPA version being released.
26+
27+
Required Arguments:
28+
-v VERSION Version of the Cluster API Provider AWS (CAPA) being released
29+
-p PREVIOUS_VERSION Current CAPA version previously released
30+
-o GH_ORG_NAME GitHub organization name
31+
-r GH_REPO_NAME GitHub repository name
32+
-c CORE_CONTROLLER_PROMOTED_IMG Image used for this release
33+
EOF
34+
}
35+
36+
while getopts "v:p:o:r:c:h" opt; do
37+
case $opt in
38+
v)
39+
VERSION=${OPTARG}
40+
;;
41+
p)
42+
PREVIOUS_VERSION=${OPTARG}
43+
;;
44+
o)
45+
GH_ORG_NAME=${OPTARG}
46+
;;
47+
r)
48+
GH_REPO_NAME=${OPTARG}
49+
;;
50+
c)
51+
CORE_CONTROLLER_PROMOTED_IMG=${OPTARG}
52+
;;
53+
h)
54+
show_help
55+
exit 0
56+
;;
57+
*)
58+
show_help >&2
59+
exit 1
60+
;;
61+
esac
62+
done
63+
2064
echo "# Release notes for Cluster API Provider AWS (CAPA) $VERSION"
2165
echo "[Documentation](https://cluster-api-aws.sigs.k8s.io/)"
2266
echo "# Changelog since $PREVIOUS_VERSION"

0 commit comments

Comments
 (0)