Version Plugin

Use this plugin to tag and push a release to a repository

It will automatically tag, merge branches and maintain a Ctl/VERSION file in the targeted repository.

Config Example

ctl:
  plugins:

    # we will use a git plugin instance to manage the repo

    - type: git
      name: my_repo
      config:
        repo_url: git@github.com:path/to/repo

    # next we define an instance for the `version` plugin

    - type: version
      name: version
      config:

        # we want to default to the git repo plugin we
        # configured above
        #
        # this is optional, and can be set / overridden
        # when executing the plugin

        repository: my_repo

        # branches used during `merge_release` operation
        # branch_dev: dev
        # branch_release: master

Command Examples

Tag the repository we specified in the repository config attribute above

# update Ctl/VERSION to 1.0.0
# tag 1.0.0
# push tag
ctl version tag 1.0.0

If you're using the version plugin for the first time on a repo and a Ctl/VERSION file does not exist yet you can pass the --init option to create it.

# create Ctl/VERSION file
# update Ctl/VERSION to 1.0.0
# tag 1.0.0
# push tag
ctl version tag 1.0.0 --init

You may also chose to bump a semantic version

# update Ctl/VERSION from 1.0.0 to 1.1.0
# tag 1.1.0
# push tag
ctl version bump minor

Use existing repository checkout

Instead of configuring and specifying a git type plugin to use you can also set repository to a directory path. It still needs to be the location of a valid git checkout.

ctl:
  plugins:
    - type: version
      name: version
      config:
        repository: /path/to/my/repository/checkout

Specifying repository in the command line

It is also possible to specify a repository when running the command.

ctl version tag 1.0.0 /path/to/my/repository
ctl version tag 1.0.0 .
ctl version tag 1.0.0 [plugin_name]

Usage

Plugin name

This usage documentation assumes that the plugin instance name is version

usage: ctl version [-h] {tag,bump,merge_release} ...

optional arguments:
  -h, --help            show this help message and exit

Operation:
  {tag,bump,merge_release}
    tag                 tag with a specified version
    bump                bump semantic version
    merge_release       merge dev branch into release branch (branches defined
                        in config)

Tag

usage: ctl version tag [-h] [--release | --init] version [repository]

positional arguments:
  version     version string to tag with
  repository  name of repository type plugin or path to a repository checkout

optional arguments:
  -h, --help  show this help message and exit
  --release   if set will also perform `merge_release` operation and tag in
              the specified release branch instead of the currently active
              branch
  --init      automatically create Ctl/VERSION file if it does not exist

Bump

usage: ctl version bump [-h] [--release | --init] [--no-auto-dev]
                        [--no-changelog-validate]
                        {major,minor,patch,dev} [repository]

positional arguments:
  {major,minor,patch,dev}
                        bumps the specified version segment by 1
  repository            name of repository type plugin or path to a repository
                        checkout

optional arguments:
  -h, --help            show this help message and exit
  --release             if set will also perform `merge_release` operation and
                        tag in the specified release branch instead of the
                        currently active branch
  --init                automatically create Ctl/VERSION file if it does not
                        exist
  --no-auto-dev         disable automatic bumping of dev version after bumping
                        `major`, `minor` or `patch`
  --no-changelog-validate
                        DISABLE If a changelog data file (CHANGELOG.yaml)
                        exists, validate before tagging

Merge_Release

usage: ctl version merge_release [-h] [repository]

positional arguments:
  repository  name of repository type plugin or path to a repository checkout

optional arguments:
  -h, --help  show this help message and exit