Skip to content

gitops-tools/yaml-versioner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaml-versioner

This is a small tool for bumping SemVer versions in YAML files.

NOTE: This is a very early version - it works, but it's not particularly hardened.

Usage

$ yaml-versioner increment --filename pkg/versioner/testdata/Chart.yaml --key version --patch=true

This would update the file pkg/versioner/testdata/Chart.yaml as a YAML file, incrementing the SemVer in the top-level .version key, but only incrementing the patch level.

If the file looked like this:

apiVersion: v2
name: test-controller
description: A Helm chart for Kubernetes
type: application
version: 1.0.1
appVersion: "1.0.0"

Then it would get changed to look like this:

apiVersion: v2
name: test-controller
description: A Helm chart for Kubernetes
type: application
version: 1.0.2
appVersion: "1.0.0"

With a diff of

type: application
- version: 1.0.1
+ version: 1.0.2
appVersion: "1.0.0"

Incrementing the minor version

Incrementing the minor level will result in the patch level being reset to zero.

$ yaml-versioner increment --filename pkg/versioner/testdata/Chart.yaml --key version --minor=true

type: application
- version: 1.0.1
+ version: 1.1.0
appVersion: "1.0.0"

TODO

  • Pre-release data in the CLI
  • Build metadata in the CLI
  • Replace rather than increment (set a specific version) for example, this would allow bumping the .appVersion in the YAML above

About

YAML version updates automated!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors