opschain templates assign
templates
opschain templates assign <project>/<code> --version <v> --asset <path> [--asset <path> ...]
Assigns a template version to assets: each named asset is repinned to the given version of its own template (an asset belonging to a different template is refused by the server) and refreshes its action catalog from the version's pinned revision. Needs the update right on the template and on every named asset.
Asset paths take the node-path form, e.g.
demo/environments/dev/assets/web — a leading /projects/ is accepted and
a bare path gets it prepended.
Flags
| Flag | Meaning |
|---|---|
--version <v> | The version to assign (required). |
--asset <path> | An asset node path to repin (repeatable, required). |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Assigned — prints assigned version <v> of <project>/<code> to <n> asset(s). |
| 1 | The template was not found, or the server refused (unknown version, an asset of another template, missing rights). |
| 2 | Usage error — missing required flags, malformed address or asset path, no server target. |
Named errors
required flag(s) "asset", "version" not set— exit 2.expected a node path like demo, demo/environments/dev, /projects/demo/environments/dev/assets/web or demo/entities/rack_1, got "<path>"— a malformed--assetvalue (exit 2).<path> is an entity — an entity has no template and nothing runs against it, so it cannot be assigned a template version— an entity path as an--assetvalue (exit 2).expected <project>/<template-code>, got "<arg>"— exit 2.template "<code>" not found in project "<project>"— exit 1.
Examples
opschain templates assign demo/web_stack --version 1.1.0 \
--asset demo/environments/dev/assets/web \
--asset demo/environments/dev/assets/api
assigned version 1.1.0 of demo/web_stack to 2 asset(s)
See also
opschain docs cli/templates-show— which assets sit on which version.opschain docs cli/templates-version-upsert— rolling pinned assets with the in-use override instead of reassigning them.