references
On this page
Usage
Options
Description
Add aggregation information specified in a reference file to a component version. So far only component archives are supported as target.
This command accepts reference specification files describing the references to add to a component version. Elements must follow the reference meta data description scheme of the component descriptor.
The description file might contain:
- a single reference
- a list of references under the key
references
- a list of yaml documents with a single reference or reference list
It is possible to describe a single reference via command line options.
The meta data of this element is described by the argument of option –reference
,
which must be a YAML or JSON string.
Alternatively, the name and version can be specified with the
options –name
and –version
. With the option –extra
it is possible to add extra identity attributes. Explicitly specified options
override values specified by the –reference
option.
(Note: Go templates are not supported for YAML-based option values. Besides
this restriction, the finally composed element description is still processed
by the selected template engine.)
The component name can be specified with the option –component
.
Therefore, basic references not requiring any additional labels or extra
identities can just be specified by those simple value options without the need
for the YAML option.
All yaml/json defined resources can be templated.
Variables are specified as regular arguments following the syntax <name>=<value>
.
Additionally settings can be specified by a yaml file using the –settings
option. With the option –addenv
environment variables are added to the binding.
Values are overwritten in the order environment, settings file, command line settings.
Note: Variable names are case-sensitive.
Example:
<command> <options> -- MY_VAL=test <args>
There are several templaters that can be selected by the –templater
option:
go
go templating supports complex values.key: subkey: "abc {{.MY_VAL}}"
none
do not do any substitution.spiff
spiff templating.It supports complex values. the settings are accessible using the binding
values
.key: subkey: "abc (( values.MY_VAL ))"
subst
simple value substitution with thedrone/envsubst
templater.It supports string values, only. Complex settings will be json encoded.
key: subkey: "abc ${MY_VAL}"
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.
All yaml/json defined resources can be templated.
Variables are specified as regular arguments following the syntax <name>=<value>
.
Additionally settings can be specified by a yaml file using the –settings
option. With the option –addenv
environment variables are added to the binding.
Values are overwritten in the order environment, settings file, command line settings.
Note: Variable names are case-sensitive.
Example:
<command> <options> -- MY_VAL=test <args>
There are several templaters that can be selected by the –templater
option:
go
go templating supports complex values.key: subkey: "abc {{.MY_VAL}}"
none
do not do any substitution.spiff
spiff templating.It supports complex values. the settings are accessible using the binding
values
.key: subkey: "abc (( values.MY_VAL ))"
subst
simple value substitution with thedrone/envsubst
templater.It supports string values, only. Complex settings will be json encoded.
key: subkey: "abc ${MY_VAL}"
Examples
See Also
- ocm add — Add elements to a component repository or component version