CLICommands
versionLast updated on
Last updated on
Bump artifact version numbers
Bumps the semantic version in an artifact file.
Usage
ofm version <file> <bump-type>Arguments
| Argument | Description |
|---|---|
file | Artifact file to bump version |
bump-type | Bump type or specific version |
Bump types
| Type | Description | Example |
|---|---|---|
major | Bump major version | 1.2.3 → 2.0.0 |
minor | Bump minor version | 1.2.3 → 1.3.0 |
patch | Bump patch version | 1.2.3 → 1.2.4 |
premajor | Bump to next major prerelease | 1.2.3 → 2.0.0-0 |
preminor | Bump to next minor prerelease | 1.2.3 → 1.3.0-0 |
prepatch | Bump to next patch prerelease | 1.2.3 → 1.2.4-0 |
prerelease | Bump prerelease version | 1.2.3-0 → 1.2.3-1 |
<version> | Set specific version | 1.2.3 → 2.5.0 |
Description
The version command reads an artifact file, validates it, updates the version field according to semantic versioning rules, and writes the file back.
Examples
Bump patch version:
ofm version my-form.yaml patchBump minor version:
ofm version my-form.yaml minorSet specific version:
ofm version my-form.yaml 2.0.0Output
✓ Version bumped: 1.2.3 → 1.3.0
Updated: my-form.yaml
Next steps:
ofm add my-form.yaml
ofm commit -m "Bump version to 1.3.0"Error handling
Invalid bump type:
Error: Invalid bump type: invalid
Valid types: major, minor, patch, premajor, preminor, prepatch, prerelease, or a specific versionMissing version field:
Error: Artifact does not have a version field