jx changelog create

Creates a changelog for a git tag Aliases: changelog,changes,publish

Usage

jx changelog create

Synopsis

Creates 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 your git provider needs a git API token which is usually provided via the Tekton git authentication mechanism.

Apart from using your git provider as the issue tracker there is also support for Jira. You then specify issues in commit messages with the issue key that looks like ABC-123. You can configure this in in similar ways as environments, see https://jenkins-x.io/v3/develop/environments/config/. An example configuration:

issueProvider: jira: serverUrl: https://example.atlassian.net userName: user@example.com

Jira API token is taken from the environment variable JIRA_API_TOKEN. Can be populated using the jx-boot-job-env-vars secret.

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

Examples

# generate a changelog on the current source
jx-changelog create

# specify the version to use
jx-changelog create --version 1.2.3

# specify the version and a header template
jx-changelog create --header-file docs/dev/changelog-header.md --version 1.2.3

Options

  -b, --batch-mode                   Runs in batch mode without prompting for user input
      --build string                 The Build number which is used to update the PipelineActivity. If not specified its defaulted from the '$BUILD_NUMBER' environment variable
      --changelog-separator string   the separator to use when splitting commit message from changelog in the pull request body. Default to ----- or if set the CHANGELOG_SEPARATOR environment variable
      --conditional-release          Wrap the Release YAML in the helm Capabilities.APIVersions.Has if statement (default true)
  -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 to search for the .git to discover the git source URL (default ".")
      --draft                        The git provider release is marked as draft
  -e, --exclude-regexp string        Regexp for excluding commits. Can be set with environment variable CHANGELOG_EXCLUDE_REGEXP. (default "^release ")
      --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
      --git-kind string              the kind of git server to connect to
      --git-server string            the git server URL to create the git provider client. If not specified its defaulted from the current source URL
      --git-token string             the git token used to operate on the git repository
      --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 create
      --include-changelog            Should changelogs from pull requests be included. (default true)
      --include-merge-commits        Include merge commits when generating the changelog
      --log-level string             Sets the logging level. If not specified defaults to $JX_LOG_LEVEL
      --no-dev-release               Disables the generation of Release CRDs in the development namespace to track releases being performed
      --output-markdown string       Put the changelog output in this file
  -o, --overwrite                    overwrites the Release CRD YAML file if it exists
      --prerelease                   The git provider release is marked as a pre-release
      --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")
      --rev string                   the current tag revision
      --status-path string           The path to the deployment status file used to calculate dependency updates. (default "docs/releases.yaml")
      --tag-prefix string            prefix to filter on when searching for version tags
  -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)
      --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
  -v, --version string               The version to release

Source

jenkins-x-plugins/jx-changelog


Last modified January 3, 2023: chore: regenerated plugin docs (57e08218b2)