Skip to content

Commit

Permalink
Fix apache#2834: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpoth authored and bouskaJ committed Apr 7, 2022
1 parent 3a599df commit 4649abb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/modules/ROOT/pages/cli/cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,13 @@ $ kamel <command> --help

Some command options in the CLI can be also specified as modeline in the source file, take a look at the xref:cli/modeline.adoc[Modeline] section
for more information.

[[image-registry]]
== Image Registry

The CLI can be used to xref:configuration/dependencies.adoc#local-dependencies[upload] content to the Image Registry.
To do so, the registry options need to be correctly set during xref:installation/registry/registry.adoc#configuring-registry[installation].
If the Image Registry uses a custom certificate authority then it needs to be trusted by the CLI see
link:https://go.dev/src/crypto/x509/root_unix.go[SSL_CERT_FILE].
If the Image registry uses authentication then it should be configured correctly in `$HOME/.docker/config.json`;
see link:https://docs.docker.com/engine/reference/commandline/login/[Docker Credentials store]].
18 changes: 18 additions & 0 deletions docs/modules/ROOT/pages/configuration/dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ kamel run -d mvn:com.google.guava:guava:26.0-jre Integration.java
```
Note that if your dependencies belong to a private repository, this repository needs to be defined. See xref:configuration/maven.adoc[Configure maven].

[[local-dependencies]]
*Local dependencies* can be added using the `-d` flag and the `file://` prefix:
```
kamel run -d file://path/to/integration-dep.jar Integration.java
```

The contents `integration-dep.jar` will then be accessible in your integration for you to use.

You can also specify data files to be mounted in the running container:

```
kamel run -d file://path/to/data.csv:path/in/container/data.csv Integration.java
```

Specifying a directory with also work recursively.

Note that this feature relies on the Image Registry being setup xref:cli/cli.adoc#configuring-registry[correctly].

[[dependencies-kind-jitpack]]
=== Jitpack dependencies

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,12 @@ func (o *runCmdOptions) createOrUpdateIntegration(cmd *cobra.Command, c client.C
if err != nil {
return nil, err
}
if platform.Spec.Build.Registry.CA == "" {
if platform.Spec.Build.Registry.CA != "" {
fmt.Printf("We've noticed the image registry is configured with a custom certificate [%s] \n", platform.Spec.Build.Registry.CA)
fmt.Println("Please make sure Node.js is configured to use it or the operation will fail.")
fmt.Println("More information can be found here https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file")
}
if platform.Spec.Build.Registry.Secret == "" {
if platform.Spec.Build.Registry.Secret != "" {
fmt.Printf("We've noticed the image registry is configured with a Secret [%s] \n", platform.Spec.Build.Registry.Secret)
fmt.Println("Please configure Docker authentication correctly or the operation will fail (by default it's $HOME/.docker/config.json).")
fmt.Println("More information can be found here https://docs.docker.com/engine/reference/commandline/login/")
Expand Down
2 changes: 1 addition & 1 deletion resources/traits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ traits:
- Knative
- OpenShift
description: The Registry trait sets up Maven to use the Image registry as a Maven
repository
repository.
properties: []
- name: route
platform: false
Expand Down

0 comments on commit 4649abb

Please sign in to comment.