jx step changelog

list of jx commands

jx step changelog

Creates a changelog for a git tag

Synopsis

Generates a Changelog for the latest tag

This command will generate a Changelog as markdown for the git commit range given. If you are using GitHub it will also update the GitHub Release with the changelog. You can disable that by passing’–update-release=false'

If you have just created a git tag this command will try default to the changes between the last tag and the previous one. You can always specify the exact Git references (tag/sha) directly via ‘–previous-rev’ and ‘–rev’

The changelog is generated by parsing the git commits. It will also detect any text like ‘fixes #123’ to link to issue fixes. You can also use Conventional Commits notation: https://conventionalcommits.org/ to get a nicer formatted changelog. e.g. using commits like ‘fix:(my feature) this my fix’ or ‘feat:(cheese) something’

This command also generates a Release Custom Resource Definition you can include in your helm chart to give metadata about the changelog of the application along with metadata about the release (git tag, url, commits, issues fixed etc). Including this metadata in a helm charts means we can do things like automatically comment on issues when they hit Staging or Production; or give detailed descriptions of what things have changed when using GitOps to update versions in an environment by referencing the fixed issues in the Pull Request.

You can opt out of the release YAML generation via the ‘–generate-yaml=false’ option

To update the release notes on GitHub / Gitea this command needs a git API token.

By default jx commands look for a file ‘~/.jx/gitAuth.yaml’ to find the API tokens for Git servers. You can use ‘jx create git token’ to create a Git token.

Alternatively if you are running this command inside a CI server you can use environment variables to specify the username and API token. e.g. define environment variables GIT_USERNAME and GIT_API_TOKEN

jx step changelog [flags]

Examples

  # generate a changelog on the current source
  jx step changelog
  
  # specify the version to use
  jx step changelog --version 1.2.3
  
  # specify the version and a header template
  jx step changelog --header-file docs/dev/changelog-header.md --version 1.2.3

Options

      --build string               The Build number which is used to update the PipelineActivity. If not specified its defaulted from  the '$BUILD_NUMBER' environment variable
  -c, --crd                        Generate the CRD in the chart
      --crd-yaml-file string       the name of the file to generate the Release CustomResourceDefinition YAML (default "release-crd.yaml")
      --dir string                 The directory of the Git repository. Defaults to the current working directory
      --fail-if-no-commits         Do we want to fail the build if we don't find any commits to generate the changelog
      --footer string              The changelog footer in markdown for the changelog. Can use go template expressions on the ReleaseSpec object: https://golang.org/pkg/text/template/
      --footer-file string         The file name of the changelog footer in markdown for the changelog. Can use go template expressions on the ReleaseSpec object: https://golang.org/pkg/text/template/
  -y, --generate-yaml              Generate the Release YAML in the local helm chart (default true)
      --header string              The changelog header in markdown for the changelog. Can use go template expressions on the ReleaseSpec object: https://golang.org/pkg/text/template/
      --header-file string         The file name of the changelog header in markdown for the changelog. Can use go template expressions on the ReleaseSpec object: https://golang.org/pkg/text/template/
  -h, --help                       help for changelog
      --include-merge-commits      Include merge commits when generating the changelog
      --no-dev-release             Disables the generation of Release CRDs in the development namespace to track releases being performed
      --output-markdown string     The file to generate for the changelog output if not updating a Git provider release
  -o, --overwrite                  overwrites the Release CRD YAML file if it exists
      --previous-date string       the previous date to find a revision in format 'MonthName dayNumber year'
  -p, --previous-rev string        the previous tag revision
      --release-yaml-file string   the name of the file to generate the Release YAML (default "release.yaml")
  -r, --rev string                 the current tag revision
  -t, --templates-dir string       the directory containing the helm chart templates to generate the resources
      --update-release             Should we update the release on the Git repository with the changelog (default true)
  -v, --version string             The version to release

Options inherited from parent commands

  -b, --batch-mode   Runs in batch mode without prompting for user input
      --verbose      Enables verbose output. The environment variable JX_LOG_LEVEL has precedence over this flag and allows setting the logging level to any value of: panic, fatal, error, warn, info, debug, trace

SEE ALSO

Auto generated by spf13/cobra on 2-Sep-2020