Skip to content

Commit 2f76104

Browse files
authored
Update README.md
1 parent 93780b2 commit 2f76104

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,59 @@ This is a small tool for bumping [SemVer](https://semver.org/) versions in YAML
55
**NOTE**: This is a very early version - it works, but it's not particularly
66
hardened.
77

8-
Usage:
8+
## Usage
99

1010
```shell
1111
$ yaml-versioner increment --filename pkg/versioner/testdata/Chart.yaml --key version --patch=true
1212
```
1313

14+
This would update the file `pkg/versioner/testdata/Chart.yaml` as a YAML file, incrementing the [SemVer](https://semver.org/) in the top-level `.version` key, but only incrementing the _patch_ level.
15+
16+
If the file looked like this:
17+
18+
```yaml
19+
apiVersion: v2
20+
name: test-controller
21+
description: A Helm chart for Kubernetes
22+
type: application
23+
version: 1.0.1
24+
appVersion: "1.0.0"
25+
```
26+
27+
Then it would get changed to look like this:
28+
29+
```yaml
30+
apiVersion: v2
31+
name: test-controller
32+
description: A Helm chart for Kubernetes
33+
type: application
34+
version: 1.0.2
35+
appVersion: "1.0.0"
36+
```
37+
With a diff of
38+
39+
```diff
40+
type: application
41+
- version: 1.0.1
42+
+ version: 1.0.2
43+
appVersion: "1.0.0"
44+
```
45+
46+
## Incrementing the minor version
47+
48+
Incrementing the _minor_ level will result in the patch level being reset to zero.
49+
50+
$ yaml-versioner increment --filename pkg/versioner/testdata/Chart.yaml --key version --minor=true
51+
52+
```diff
53+
type: application
54+
- version: 1.0.1
55+
+ version: 1.1.0
56+
appVersion: "1.0.0"
57+
```
58+
1459
## TODO
1560
16-
[ ] Metadata in the CLI
17-
[ ] Replace rather than increment (set a specific version)
61+
* [ ] [Pre-release data](https://semver.org/#spec-item-9) in the CLI
62+
* [ ] [Build metadata](https://semver.org/#spec-item-10) in the CLI
63+
* [ ] Replace rather than increment (set a specific version) for example, this would allow bumping the `.appVersion` in the YAML above

0 commit comments

Comments
 (0)