From a8beef5eae0831ffab1f5f26c5e456dfab82f8bb Mon Sep 17 00:00:00 2001 From: John Poth Date: Wed, 12 Jul 2023 11:13:29 +0200 Subject: [PATCH] Fix(docs): enhance the documentation on using local and remote dependencies --- docs/modules/ROOT/pages/cli/cli.adoc | 14 +++++++---- .../pages/configuration/dependencies.adoc | 25 ++++++++++++++----- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/docs/modules/ROOT/pages/cli/cli.adoc b/docs/modules/ROOT/pages/cli/cli.adoc index 0aadda5dde..d34a73d86c 100644 --- a/docs/modules/ROOT/pages/cli/cli.adoc +++ b/docs/modules/ROOT/pages/cli/cli.adoc @@ -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]]. + + + diff --git a/docs/modules/ROOT/pages/configuration/dependencies.adoc b/docs/modules/ROOT/pages/configuration/dependencies.adoc index 5ae7d01804..78861d15b2 100644 --- a/docs/modules/ROOT/pages/configuration/dependencies.adoc +++ b/docs/modules/ROOT/pages/configuration/dependencies.adoc @@ -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