ocm add componentversions — Add Component Version(S) To A (New) Transport Archive
Synopsis:
ocm add componentversions [<options>] [--version <version>] [<ctf archive>] {<component-constructor.yaml>}
Aliases:
componentversions, componentversion, cv, components, component, comps, comp, c
Options:
--addenv access environment for templating
-C, --complete include all referenced component version
-L, --copy-local-resources transfer referenced local resources by-value
-V, --copy-resources transfer referenced resources by-value
-c, --create (re)create archive
--dry-run evaluate and print component specifications
-F, --file string target file/directory (default "transport-archive")
-f, --force remove existing content
-h, --help help for componentversions
--lookup stringArray repository name or spec for closure lookup fallback
-O, --output string output file for dry-run
-P, --preserve-signature preserve existing signatures
-R, --replace replace existing elements
-S, --scheme string schema version (default "v2")
-s, --settings stringArray settings file with variable settings (yaml)
--skip-digest-generation skip digest creation
--templater string templater to use (go, none, spiff, subst) (default "subst")
-t, --type string archive format (directory, tar, tgz) (default "directory")
--uploader <name>=<value> repository uploader (<name>[:<artifact type>[:<media type>[:<priority>]]]=<JSON target config>) (default [])
-v, --version string default version for components
Description:
Add component versions specified by a constructor file to a Common Transport
Archive. The archive might be either a directory prepared to host component version
content or a tar/tgz file (see option --type).
If option «--create» is given, the archive is created first. An
additional option «--force» will recreate an empty archive if it
already exists.
If option «--complete» is given all component versions referenced by
the added one, will be added, also. Therefore, the «--lookup» is required
to specify an OCM repository to lookup the missing component versions. If
additionally the «-V» is given, the resources of those additional
components will be added by value.
The «--replace» option allows users to specify whether adding an
element with the same name and extra identity but different version as an
existing element, append (false) or replace (true) the existing element.
The «--preserve-signature» option prohibits changes of signature
relevant elements.
The source, resource and reference list can be composed according to the commands
«ocm add sources», «ocm add resources», «ocm add references»,
respectively.
The description file might contain:
- a single component as shown in the example
- a list of components under the key «components»
- a list of yaml documents with a single component or component list
The optional field «meta.configuredSchemaVersion» for a component
entry can be used to specify a dedicated serialization format to use for the
component descriptor. If given it overrides the «--schema» option
of the command. By default, v2 is used.
Various elements support to add arbitrary information by using labels
(see «ocm ocm-labels»).
The «--type» option accepts a file format for the
target archive to use. It is only evaluated if the target
archive does not exist yet. The following formats are supported:
- directory
- tar
- tgz
The default format is «directory».
Description
In OCM, we interface with component construction through the
ocm add componentversioncommand. This command is able to interpret a special file format called thecomponent-constructor.yamlwith a dedicated scheme that supports a special specification attribute for resources and sources calledinput. This input is a specification that declares how resources are newly added / "input" to a component version.The targeted set of support criteria are:
--addenv--copy-resourcesflag support, default false--copy-local-resourcesflag support will be OMITTED--createwill be OMITTED and defaulted to true always--dry-runsupport will be omitted because resources MUST be uploaded to preserve signatures and it cannot be known how the descriptor looks without uploading, making dry-run inaccurate. Instead, replace with--upload-cvthat dictates if the final component version will be uploaded or not. similarly,--outputwill be renamed to--cv-output--filesupport as before--forceas before, overwriting a component version if it already exists--lookupwill be OMITTED in favor of .ocmconfig style configurations only--preserve-signaturewill be OMITTED, because there will not be preexisting signatures in a yet to be created component version--replacewill be OMITTED because of its conflicting nature with behavior to force. Instead only whole component versions can be wholly replaced in the future--schemeonly with v2 support--settingswill be OMITTED due to lack of templating engine necessity--skip-digest-generationwith default false will be replaced with--generate-digestswith default true--templatershould be OMITTED (see above, separate story)--typewill be renamed to--archive-typeto make it clear it applies only for CTFs. Since uploading to OCI repositories will also be possible, this flag should error when directly uploading to OCI.--uploaderwill be omitted (uploader concept made obsolete through our plugin system)Done Criteria