Skip to content

Commit

Permalink
Fix(docs): enhance the documentation on using local and remote depend…
Browse files Browse the repository at this point in the history
…encies
  • Loading branch information
johnpoth authored and squakez committed Jul 17, 2023
1 parent a421a3c commit a8beef5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
14 changes: 9 additions & 5 deletions docs/modules/ROOT/pages/cli/cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ 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[installation].
If the Image Registry uses a custom certificate authority then it needs to be trusted by the CLI see
The CLI can be used to xref:configuration/dependencies.adoc#local-remote-dependencies[upload] Maven dependencies and user data to the Image Registry. To do so, the CLI and the Operator have to be configured correctly.

For the Operator part, have a look at the xref:installation/registry/registry.adoc[installation] documentation.

For the CLI, in most cases, executing `docker login REGISTRY_URL` successfully will suffice.
If the Image Registry uses a custom certificate authority then it needs to be trusted, 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]].



25 changes: 19 additions & 6 deletions docs/modules/ROOT/pages/configuration/dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,36 @@ 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:installation/advanced/maven.adoc[Configure maven].

[[local-dependencies]]
[[local-remote-dependencies]]
=== Local and remote 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 content of `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:
You can also specify data files and directories which will be mounted in the running container relative to the working directory:

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

Specifying a directory with also work recursively.
If the data files needs to be present at build time, you can also set `classpath` option to `true`:

```
kamel run -d file://path/to/data.csv?targetPath=/in/container/data.csv&classpath=true Integration.java
```

Similarly, *remote dependencies* can be added with the `http(s)://` prefix:

```
kamel run -d https://raw.githubusercontent.com/example/data.csv|targetPath=/tmp/foo&classpath=true Integration.java
```

For a full list of options checkout `kamel run --help`.


Note that this feature relies on the Image Registry being setup xref:cli/cli.adoc[correctly].
*Important note*: this will upload the dependencies and data files to the Image Registry. The CLI and Operator need to be setup xref:cli/cli.adoc[correctly], especially if authentication or custom certificates are required.

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

0 comments on commit a8beef5

Please sign in to comment.