Skip to content

ccin2p3/puppet-modulator

Repository files navigation

Puppet Modulator

pipeline status coverage report

Description

High level wrapper that allows to:

  • quickly edit metadata.json version field
  • wrap git-flow with common Puppet module edition workflows

Complete documentation

The complete documentation can be found at https://cc-in2p3-puppet-master-tools.pages.in2p3.fr/puppet-modulator/.

Usage

❯ puppet-modulator -h
Usage:
  puppet-modulator [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  flow       A git-flow high-level wrapper for hotfixes and releases
  help        Help about any command
  metadata    Manipulate module metadata.json file
  version     Display software version and exit

Flags:
      --config string   config file (default is $HOME/.puppet-modulator.yaml)
  -d, --debug           Enable debug
  -h, --help            help for puppet-modulator

Use "puppet-modulator [command] --help" for more information about a command.

Pro tip: set an alias

If puppet-modulator is too long for you to type, just set an alias such as alias pm="puppet-modulator" and all the commands will become

$ pm flow hotfix start

and so on

Git-flow wrappers

Hotfix

❯ puppet-modulator flow hotfix -h
A git-flow high-level wrapper for hotfixes

Usage:
  puppet-modulator flow hotfix [command]

Available Commands:
  finish      A git-flow high-level wrapper to finish hotfixes
  start       A git-flow high-level wrapper to start hotfixes

Flags:
  -h, --help   help for hotfix

Global Flags:
      --config string   config file (default is $HOME/.puppet-modulator.yaml)
  -d, --debug           Enable debug

Use "puppet-modulator flow hotfix [command] --help" for more information about a command.

Release

❯ puppet-modulator flow release -h
A git-flow high-level wrapper for releases

Usage:
  puppet-modulator flow release [command]

Available Commands:
  finish      A git-flow high-level wrapper to finish releases
  start       A git-flow high-level wrapper to start releases

Flags:
  -h, --help   help for release

Global Flags:
      --config string   config file (default is $HOME/.puppet-modulator.yaml)
  -d, --debug           Enable debug

Use "puppet-modulator flow release [command] --help" for more information about a command.

Metadata manipulation

Bump versions

❯ puppet-modulator metadata -h
Manipulate module metadata.json file

Usage:
  puppet-modulator metadata [command]

Available Commands:
  bump
  set-version Set exact module version

Flags:
  -g, --git-commit                       Commit changes to git
  -m, --git-commit-msg string            Git commit message (default "[meta] Bump version")
  -h, --help                             help for metadata
  -p, --keys-sort-commit-policy string   policy related to metadata keys sort commit. If pre-commit is used, then a dedicated commit will be created dedicated to metadata keys sorting. If no-pre-commit is used, metadata keys sorting will still occurs, but no dedicated commit will be created (default "pre-commit")
  -o, --output string                    Where to write metadata to. Defaults to modify metadata in-place

Global Flags:
      --config string   config file (default is $HOME/.puppet-modulator.yaml)
  -d, --debug           Enable debug

Use "puppet-modulator metadata [command] --help" for more information about a command.

Install

Pre-compiled binaries are available in the release page.

Git flow subcommands

Release and Hotfix version auto-guess

If you do not specify a version in your puppet-modulator flow hotfix start or puppet-modulator flow release start command, puppet-modulator will admit that you're trying to work quickly and use the most common version bump logic for those operations.

This mean that:

  • for a hotfix, it will increment the patch version
  • for a release, it will increment the minor version

Important:

  • If you don't want to use the version auto-guess feature, you'll have to explicitly specify a version on command-line.
  • If you want to specify a base reference branch and still use the auto-guess feature, you can use "" (empty string) for the version, or ? (question mark).

Examples

Metadata manipulation

Bump version without auto commit

Bump version without auto commit

Bump version with auto commit

Bump version with auto commit

Git flow release

Start and finish a git-flow release

Start and finish a git-flow release

TODO

Git flow

  • Add a subcommand or flag to allow for flash releases that would allow developer to start, commit, finish a release with only one command

Metadata

  • Add command to add a module dependency (with SemVer range validation / helpers)