Skip to content
Permalink
Browse files

Update the development guide + add changelog script (#2368)

**What kind of PR is this?**
<!--
DELETE the kind(s) which are not applicable before opening the PR.
-->

/kind code-refactorting
/kind docs

**What does does this PR do / why we need it**:

- Adds changelog script to quickly generate a changelog using
github_changelog_generator

**Which issue(s) this PR fixes**:

Fixes N/A

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
  • Loading branch information
cdrage authored and openshift-merge-robot committed Nov 13, 2019
1 parent 3543df3 commit 57c2335c8492b0ba0c952ba6e659b461e6afdde4
Showing with 62 additions and 11 deletions.
  1. +8 −11 docs/dev/development.adoc
  2. +54 −0 scripts/changelog-script.sh
@@ -429,11 +429,11 @@ $ glide --version

=== Releasing a new version

Making artifacts for a new release is automated. When a new git tag is created, the Travis-ci deploy job automatically builds binaries and uploads it to the GitHub release page.
Making artifacts for a new release is automated within RedHat's internal CI servers. Contact a maintainer for the internal link to release a new version of odo.

To release a new version:
To release a new version on GitHub:

. Create a PR that:
**Create a PR that:**

* Updates the version in the following files:

@@ -444,11 +444,6 @@ To release a new version:

There is a helper script link:../scripts/bump-version.sh[scripts/bump-version.sh] that changes version number in all the files listed above (except `odo.rb`).

* Updates the CLI reference documentation in the `docs/cli-reference.md` file:
+
----
$ make generate-cli-reference
----
. Merge the above PR.
. Once the PR is merged create and push the new git tag for the version.
+
@@ -458,15 +453,17 @@ $ git push upstream v0.0.1
----
*Or* create the new release using the GitHub site (this must be a proper release and not a draft).
+
NOTE: Do not upload any binaries for the release. When the new tag is created, Travis-CI starts a special deploy job. This job builds the binaries automatically (using `make prepare-release`) and then uploads it to the GitHub release page. When the job finishes you should see the binaries on the GitHub release page. The release is now marked as a draft.

. Update the descriptions and publish the release.
. Update the release description (changelog) on GitHub. To make things easier, a script was created to automatically generate a CHANGELOG and output to stdout.
+
----
$ ./scripts/generate-changelog.sh ${PREVIOUS_VERSION} ${NEW_VERSION}
----
. Verify that packages have been uploaded to the `rpm` and `deb` repositories.
. Update the Homebrew package:
.. Check commit id for the released tag `git show-ref v0.0.1`
.. Create a PR to update `:tag` and `:revision` in the https://github.com/kadel/homebrew-odo/blob/master/Formula/odo.rb[`odo.rb`] file
in https://github.com/kadel/homebrew-odo[`kadel/homebrew-odo`].
. Confirm the binaries are available in the GitHub release page.
. Create a PR and update the file `build/VERSION` with the latest version number.

== Writing machine readable output code
@@ -0,0 +1,54 @@
#!/bin/bash

# This script uses github_changelog_generator to generate a changelog
# by using the kind labels that we use..
#
# Then outputs it to STDOUT. This helps generate a changelog when doing a release.

# Get the variables we're going to use..
if [ -z "$GITHUB_TOKEN" ]
then
echo -e "GITHUB_TOKEN environment variable is blank..\nGet your GitHub token and then:\nexport GITHUB_TOKEN=yourtoken"
exit 1
fi

if [ -z "$1" ] || [ -z "$2" ]
then
echo -e "Must provide first and next release numbers..\nex: ./changelog-script.sh v1.0.0 v1.0.1"
exit 1
fi

MIRROR="https://mirror.openshift.com/pub/openshift-v4/clients/odo/$2/"
INSTALLATION_GUIDE="https://docs.openshift.com/container-platform/4.2/cli_reference/openshift_developer_cli/installing-odo.html"

echo -e "# Installation of $2
To install odo, follow our installation guide at [docs.openshift.com]($INSTALLATION_GUIDE)
After each release, binaries synced on [mirror.openshift.com]($MIRROR)" > /tmp/base

github_changelog_generator \
--user openshift \
--project odo \
-t $GITHUB_TOKEN \
--since-tag $1 \
--future-release $2 \
--base /tmp/base \
--output /tmp/changelog \
--header-label "# Release of $2" \
--summary-label "**Epics & Discussions:**" \
--summary-labels "kind/epic,kind/discussion,kind/design,kind/use-case" \
--enhancement-label "**Enhancements & Code Refactoring:**" \
--enhancement-labels "kind/enhancement,kind/cleanup,kind/api-change,kind/code-refactoring" \
--breaking-label "**New features:**" \
--breaking-labels "kind/feature" \
--bugs-label "**Bugs:**" \
--bug-labels "kind/bug" \
--removed-label "**Tests:**" \
--removed-labels "kind/flake,kind/test" \
--security-label "**Documentation:**" \
--security-labels "kind/docs,kind/documentation"

echo ""
echo "The changelog is located at: /tmp/changelog"
echo ""

0 comments on commit 57c2335

Please sign in to comment.
You can’t perform that action at this time.