Skip to content

Commit

Permalink
Bump version number to 4.2.0 (#4617)
Browse files Browse the repository at this point in the history
* Bump version number to 4.2.0

* Add support for banner in the changelog from a GitHub issue

* Fixes following review feedback
  • Loading branch information
nwmac authored Oct 5, 2020
1 parent 03ec621 commit 49be394
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
46 changes: 37 additions & 9 deletions build/tools/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ echo -e "${CYAN}${BOLD}===================================${RESET}"
echo -e "${YELLOW}Stratos Directory: ${STRATOS_DIR}${RESET}"
echo ""

STATE="+state:closed"
while getopts ":a" opt; do
case $opt in
a)
STATE=""
;;
esac
done

shift $((OPTIND-1))

# Get the version number from the package.json file

# This is the base repository
Expand Down Expand Up @@ -58,27 +69,43 @@ echo -e "${YELLOW}Previous version : ${BOLD}$CURRENT${RESET}"
function search() {
FILTER=$1
if [ -n "${FORK_QUERY}" ]; then
curl -s "https://api.github.com/search/issues?q=${FORK_QUERY}${FILTER}" | jq -r '.items | .[] | "- \(.title) [\\#\(.number)](\(.html_url))"' | tee -a ${CHANGELOG}
curl -s "https://api.github.com/search/issues?q=${FORK_QUERY}+-label:release-notes${FILTER}" | jq -r '.items | .[] | "- \(.title) [\\#\(.number)](\(.html_url))"' | tee -a ${CHANGELOG}
fi
curl -s "https://api.github.com/search/issues?q=${QUERY}${FILTER}" | jq -r '.items | .[] | "- \(.title) [\\#\(.number)](\(.html_url))"' | tee -a ${CHANGELOG}
curl -s "https://api.github.com/search/issues?q=${QUERY}+-label:release-notes${FILTER}" | jq -r '.items | .[] | "- \(.title) [\\#\(.number)](\(.html_url))"' | tee -a ${CHANGELOG}
}

function breaking_changes() {
FILTER=$1
if [ -n "${FORK_QUERY}" ]; then
curl -s "https://api.github.com/search/issues?q=${FORK_QUERY}${FILTER}" | jq -r '.items | .[] | "- **\(.title)**\n\n \(.body)"' > ${CHANGELOG}.breaking
curl -s "https://api.github.com/search/issues?q=${FORK_QUERY}+-label:release-notes${FILTER}" | jq -r '.items | .[] | "- **\(.title)**\n\n \(.body)"' > ${CHANGELOG}.breaking
fi
curl -s "https://api.github.com/search/issues?q=${QUERY}+-label:release-notes${FILTER}" | jq -r '.items | .[] | "- **\(.title)**\n\n \(.body)"' > ${CHANGELOG}.breaking
}


function get_banner() {
BANNER="label:release-notes"
banner=""
if [ -n "${FORK_QUERY}" ]; then
banner=$(curl -s "https://api.github.com/search/issues?q=${BANNER}+${FORK_QUERY}" | jq -r '.items | .[] | .body')
fi
if [ -z "${banner}" ]; then
banner=$(curl -s "https://api.github.com/search/issues?q=${BANNER}+${QUERY}" | jq -r '.items | .[] | .body')
fi

if [ -z "${banner}" ]; then
banner="This release contains a number of fixes and improvements:"
fi
curl -s "https://api.github.com/search/issues?q=${QUERY}${FILTER}" | jq -r '.items | .[] | "- **\(.title)**\n\n \(.body)"' > ${CHANGELOG}.breaking
}

function log() {
echo $1 | tee -a ${CHANGELOG}
echo "$1" | tee -a ${CHANGELOG}
}

COMPARE_REPO=${REPO}
QUERY="repo:${REPO}+milestone:${MILESTONE}+state:closed"
QUERY="repo:${REPO}+milestone:${MILESTONE}${STATE}"
if [ -n "${FORK}" ]; then
FORK_QUERY="repo:${FORK}+milestone:${MILESTONE}+state:closed"
FORK_QUERY="repo:${FORK}+milestone:${MILESTONE}${STATE}"
COMPARE_REPO=${FORK}
fi

Expand All @@ -88,6 +115,7 @@ BREAKING_CHANGES="+label:breaking-change"

mv ${CHANGELOG} CHANGELOG.old

get_banner

echo ""
echo -e "${CYAN}${BOLD}Generating Change log - content for version ${MILESTONE} will be shown below"
Expand All @@ -99,7 +127,7 @@ log "## ${MILESTONE}"
log ""
log "[Full Changelog](https://github.com/${COMPARE_REPO}/compare/${CURRENT}...${MILESTONE})"
log ""
log "This release contains a number of fixes and improvements:"
log "$banner"
log ""
log "**Improvements:**"
log ""
Expand Down Expand Up @@ -129,6 +157,6 @@ rm -f ${CHANGELOG}.breaking
log ""

tail -n +2 CHANGELOG.old >> ${CHANGELOG}
rm CHANGELOG.old
rm CHANGELOG.old

sed -i.bak 's/\# Change Log.*\#\# ${CURRENT}//' ${CHANGELOG}
2 changes: 1 addition & 1 deletion deploy/kubernetes/console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Check the repository was successfully added by searching for the `console`, for
```
helm search repo console
NAME CHART VERSION APP VERSION DESCRIPTION
stratos/console 4.1.0 4.1.0 A Helm chart for deploying Stratos UI Console
stratos/console 4.2.0 4.2.0 A Helm chart for deploying Stratos UI Console
```

> Note: Version numbers will depend on the version of Stratos available from the Helm repository
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stratos",
"version": "4.1.0",
"version": "4.2.0",
"description": "Stratos Console",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 49be394

Please sign in to comment.