Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
morri-son committed Dec 11, 2023
1 parent 1066720 commit 67a9f04
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/reference/ocm.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The command accepts some top level options, they can only be given before the su

With the option <code>--cred</code> it is possible to specify arbitrary credentials
for various environments on the command line. Nevertheless it is always preferrable
to use the cli config file.
to use the CLI [config file](./ocm_configfile.md).
Every credential setting is related to a dedicated consumer and provides a set of
credential attributes. All this can be specified by a sequence of <code>--cred</code>
options.
Expand Down Expand Up @@ -196,7 +196,7 @@ The value can be a simple type or a JSON/YAML string for complex values
Note that the host name part of the transfer target <code>ghcr.io/acme</code> is excluded from the
prefix but the path <code>acme</code> is considered.

The same using a config file <code>.ocmconfig</code>:
The same using a [config file](./ocm_configfile.md) <code>.ocmconfig</code>:
<pre>
type: generic.config.ocm.software/v1
configurations:
Expand Down
49 changes: 47 additions & 2 deletions docs/reference/ocm_configfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Description


The command line client supports configuring by a given configuration file.
The command line client supports configuration using a configuration file.
If existent, by default, the file <code>$HOME/.ocmconfig</code> will be read.
Using the option <code>--config</code> an alternative file can be specified.

Expand Down Expand Up @@ -287,7 +287,9 @@ The following configuration types are supported:

### Examples

```
Pointing to an existing Docker config json:

```yaml
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
Expand All @@ -306,6 +308,49 @@ configurations:
# process: true
```

Pointing to an existing Docker config json and configure two additional consumers
for a Github repository and a Helm chart repository. Caching for OCM component versions is switched on.
A key pair for signing / verifiying OCM component versions has been configured, too.

```yaml
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
consumers:
- identity:
type: HelmChartRepository
hostname: my.repository.mycomp.com
pathprefix: artifactory/myhelm-repo
port: "443"
credentials:
- type: Credentials
properties:
username: myuser
password: 8eYwL5Ru44L6ZySyLUcyP
- identity:
type: Github
hostname: github.com
credentials:
- type: Credentials
properties:
token: ghp_QRP489abcd1234A9q3x17a8BlD42kabv65
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: ~/.docker/config.json
propagateConsumerIdentity: true
- type: attributes.config.ocm.software
attributes:
cache: ~/.ocm/cache
- type: keys.config.ocm.software
privateKeys:
sap.com:
path: /Users/myuser/.ocm/keys/mycomp.com.key
publicKeys:
sap.com:
path: /Users/myuser/.ocm/keys/mycomp.com.pub
```
### SEE ALSO
##### Parents
Expand Down

0 comments on commit 67a9f04

Please sign in to comment.