|
| 1 | +# krel release-notes |
| 2 | +The subcommand of choice for the Release Notes subteam of SIG Release |
| 3 | + |
| 4 | +- [Summary](#summary) |
| 5 | +- [Installation](#installation) |
| 6 | +- [Usage](#usage) |
| 7 | +- [Important notes](#important-notes) |
| 8 | + |
| 9 | +## Summary |
| 10 | + |
| 11 | +The `release-notes` subcommand of krel is used to generate the release notes |
| 12 | +draft of a kubernetes version. The subcommand can be used to generate release notes |
| 13 | +files for a specific tag or a range of tags. It can output the notes files to Markdown or JSON formats. |
| 14 | + |
| 15 | +This subcommand can be used to generate the release notes draft for the current development version of kubernetes and the JSON version that power relnotes.k8s.io. |
| 16 | +`krel release-notes` will create a branch in a user's fork of the corresponding repositories, commit and push the changes. Filing the final PRs to the kubernetes org repositories is in development and will soon be ready. |
| 17 | + |
| 18 | +## Installation |
| 19 | +After [installing krel](README.md#installation), you will need to [get a GitHub token](https://github.com/settings/tokens) to run the release-notes subcommand. |
| 20 | + |
| 21 | +If you want to generate the JSON patches for relnotes.k8s.io you will need to have [npm](https://www.npmjs.com/) installed to run the JSON formatter. |
| 22 | + |
| 23 | +## Usage |
| 24 | + |
| 25 | +Before running `krel release-notes` export your GitHub token to $GITHUB_TOKEN: |
| 26 | +``` |
| 27 | + export GITHUB_TOKEN=YOURTOKENHERE |
| 28 | + krel release-notes [flags] |
| 29 | +``` |
| 30 | + |
| 31 | +### Command line flags |
| 32 | +``` |
| 33 | + --create-draft-pr create the Release Notes Draft PR. --draft-org and --draft-repo must be set along with this option |
| 34 | + --create-website-pr generate the Releas Notes to a local fork of relnotes.k8s.io and create a PR. --draft-org and --draft-repo must be set along with this option |
| 35 | + --draft-org string a Github organization owner of the fork of k/sig-release where the Release Notes Draft PR will be created |
| 36 | + --draft-repo string the name of the fork of k/sig-release, the Release Notes Draft PR will be created from this repository (default "sig-release") |
| 37 | + --format string The format for notes output (options: markdown, json) (default "markdown") |
| 38 | + -h, --help help for release-notes |
| 39 | + --kubernetes-sigs-fork-path string fork kubernetes-sigs/release-notes and output a copy of the json release notes to this directory (default "/tmp/k8s-sigs") |
| 40 | + -o, --output-dir string output a copy of the release notes to this directory (default ".") |
| 41 | + --sigrelease-fork-path string fork k/sig-release and output a copy of the release notes draft to this directory (default "/tmp/k8s-sigrelease") |
| 42 | + -t, --tag string version tag for the notes |
| 43 | + --website-org string a Github organization owner of the fork of kuberntets-sigs/release-notes where the Website PR will be created |
| 44 | + --website-repo string the name of the fork of kuberntets-sigs/release-notes, the Release Notes Draft PR will be created from this repository (default "release-notes") |
| 45 | +``` |
| 46 | + |
| 47 | + |
| 48 | +### Examples |
| 49 | + |
| 50 | +`krel release-notes` has three main modes of operation: |
| 51 | + |
| 52 | +#### Ouput the Releas Notes to a single file |
| 53 | +The following command will generate the release notes for the 1.18 branch up to beta.2 in /var/www/html/ |
| 54 | + |
| 55 | +```bash |
| 56 | +krel release-notes -o /var/www/html/ --format markdown --tag v1.18.0-beta.2 |
| 57 | +``` |
| 58 | +#### Generate the current markdown draft |
| 59 | +This invocation will generate the release notes draft [published in sig-release](https://github.com/kubernetes/sig-release/blob/master/releases/release-1.18/release-notes-draft.md). It will generate the draft for the v1.18 branch up to rc.1. The draft will be written in my local fork of kubernetes/sig-release. `krel release-notes` will clone k/sig-release, create a branch, write the draft and then push the changes back to github, in `kubefriend/sig-release`. |
| 60 | + |
| 61 | +```bash |
| 62 | +krel release-notes --create-draft-pr --tag v1.18.0-rc.1 --draft-org=kubefriend |
| 63 | +``` |
| 64 | + |
| 65 | +#### Update the relnotes.k8s.io website |
| 66 | +The subcommand can also generate the notes and modify the necessary files to update the [release notes website](https://relnotes.k8s.io/). This invocation will clone the [release-notes repo](https://github.com/kubernetes-sigs/release-notes) and add my fork as a remote (kubefriend/release-notes). It will then create a feature branch to commit the notes up to v1.18 alpha.1 and update the website files. Finally it will push the changes to my GitHub repo: |
| 67 | + |
| 68 | +```bash |
| 69 | +krel release-notes --tag v1.18.0-alpha.1 --website-org=kubefriend --create-website-pr |
| 70 | +``` |
| 71 | +## Important notes |
| 72 | + |
| 73 | +The /tmp defaults shown in the flags above are for Linux. Other platform will default to Go's `os.TempDir()` (for example, on a the Mac the actual path will be under `/var/folders/…` ). |
| 74 | + |
| 75 | +The release-notes subcommand will eventually create the PR for you. This is still under development though. |
0 commit comments