Genroc compares new definitions to the previous ones and if it’s a new one automatically bumps up the version.
> genctl apply
latest: hello v1 -> v2 (new)
Commands are assuming
definitionsglob in.genroc. If you don’t have that, you can use-fto specify defintion file(s).
Definitions are compared as a normalized json. If you apply an already existing version it’s not duplicated but reused (so the version can also go down if you revert a change).
> genctl apply
latest: hello v2 -> v1 (existing)
An apply moves a channel pointer, so that move is what the line reports. new minted a
version, existing matched one already stored — which is how a revert lands, with nothing
written and latest walked back to v1. A re-apply that moves nothing reads (current), and
- stands in for a channel that had no pointer yet.
Channels
Genroc uses release channels, by default latest is used, but you can specify which
channel you want to apply.
> genctl apply --channel test
test: hello - -> v3 (new) # v3 version doesn't influence latest
To start the process you can specify the channel or the version:
> genctl run hello --channel test
started: 8nte1end hello@v3 (running)
# or
> genctl run hello --version 1
started: 6nnmhxnv hello@v1 (running)
# or
> genctl run hello
started: 77fg90c5 hello@v2 (running)
You can list all the channels for given process like this:
> genctl channel list hello
latest -> v2 moved 23m ago by ...
test -> v3 moved 11m ago by ...
Channels are intended for beta versions or internal testing before release,
so you can push your definition to test channel, try if it works and then
just update the latest channel to the same version:
genctl channel promote --from test --to latest
Child/parent versioning
By default, you don’t have to specify which version of the child parent wants to use, genroc will assume you want the one from the same channel.
On apply it is decided which version of the child will the parent use and it’s baked into the saved defintion.
> genctl apply
latest: child v1 (current)
latest: parent v2 -> v3 (new)
Here the parent@v3 will always use child@v1. If we would change child, the parent defintion will
change as well, because the version is part of the defintion comparison.
> genctl apply
latest: child v1 -> v2 (new) # only child was changed
latest: parent v3 -> v4 (new) # parent was updated automatically
Explicit version
You can also explicitly specify which version you want to use in the child action.
...
tasks:
- id: greet
action:
type: child
name: welcome
version: 2
This will opt out from genroc automatic version resolution.