Skip to content

Commit

Permalink
Merge pull request #169 from open-component-model/add-config-and-exam…
Browse files Browse the repository at this point in the history
…ples

add config file and examples
  • Loading branch information
morri-son authored Dec 11, 2023
2 parents ebe04c9 + d1b8af7 commit 704702e
Show file tree
Hide file tree
Showing 3 changed files with 453 additions and 0 deletions.
25 changes: 25 additions & 0 deletions content/en/docs/cli-reference/configfile/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Config file
name: Config file
url: /docs/cli/configfile/
date: 2023-12-11T10:43:19Z
draft: false
images: []
menu:
docs:
parent: cli-reference
toc: true
isCommand: false
---
### Description

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.

### Configuration File Syntax
For a detailed description of the configuration file structure and all possible attributes see
* [Config File Syntax](/docs/cli/configfile_syntax.md) &mdash; OCM CLI configuration file syntax

### Examples
* [Config File Examples](/docs/cli/configfile_examples.md) &mdash; OCM CLI configuration file examples
72 changes: 72 additions & 0 deletions content/en/docs/cli-reference/configfile/configfile_examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Config File Examples
name: Config File Examples
url: /docs/cli/configfile/examples
date: 2023-12-11T10:43:19Z
draft: false
images: []
menu:
docs:
parent: configfile
toc: true
isCommand: true
---

### Examples for .ocmconfig files

Pointing the configuration to an existing Docker config json:

```yaml
type: generic.config.ocm.software/v1
configurations:
- type: credentials.config.ocm.software
repositories:
- repository:
type: DockerConfig/v1
dockerConfigFile: "~/.docker/config.json"
propagateConsumerIdentity: 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
```
Loading

0 comments on commit 704702e

Please sign in to comment.