The version
attribute of the manifest front maatter is for your use to keep track of manifest versioning as updates are performed to the manifest during its lifecycle, as well as to provide the user with feedback as to what version of the manifest is being applied or removed during the process.
Ideally it should be defined as the second attribute of the manifest under name
thus:
{
"name": "example",
"version": "1.0.0",
# remainder of manifest goes here ...
}
The manifest version is printed at the beginning of the installation process to signal to the user what version of the manifest they’re applying to the host system.
Access to manifest version in variables
You can access the manifest version from a command variable like this:
{
"name": "manifest",
"version": "0.0.1",
"metadata": {
"gene_system": {
"version": "0.4.0"
}
},
"steps": [
{
"name": "print manifest version",
"exe": {
"install": {
"cmd": [
"echo \"{{manifest.version}}\""
]
},
},
"tags": "example step"
}
]
}
Where this might be useful is in the event you want to save to disk the version of the manifest applied to the host system like this:
{
"name": "manifest",
"version": "0.0.1",
"metadata": {
"gene_system": {
"version": "0.4.0"
}
},
"steps": [
{
"name": "save manifest version",
"exe": {
"install": {
"cmd": [
"touch $HOME/.genesystem_{{manifest.name}}_version",
"echo \"{{manifest.version}}\" >> $HOME/.genesystem_{{manifest.name}}_version"
]
},
},
"tags": "example step"
}
]
}
You might use this to skip steps if the manifest has been applied or perhaps to help debug issues related to manifest updates.