This is an automated email from the ASF dual-hosted git repository. fmariani pushed a commit to branch jbang-user-config in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/jbang-user-config by this push: new 19efb586c88 Documentation 19efb586c88 is described below commit 19efb586c88b7c1a17d045e757edc7bcdd7996a7 Author: Croway <federico.mariani.1...@gmail.com> AuthorDate: Wed Mar 8 18:10:09 2023 +0100 Documentation --- .../modules/ROOT/pages/camel-jbang.adoc | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc index 8da94028258..14b4f4b19ae 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc @@ -1807,6 +1807,79 @@ The follow options related to _exporting_, can be configured in `application.pro NOTE: These are options from the export command, so you can see mor details and default values using `camel export --help`. +== Configuration + +Camel JBang can be used to store and use user configuration so that cli options won't have to be specified each time, for example, in order to run a different camel version, instead of executing + +[source,bash] +---- +camel run * --camel-version=3.18.4 +---- + +the option camel-version can be added to the user configuration like + +[source,bash] +---- +camel config set camel-version=3.18.4 +---- + +and then, the run command will pick the user configuration + +[source,bash] +---- +camel run * +---- + +The user configuration file will be stored in ~/.camel-jbang-user.properties + +=== Set and unset configuration + +Every Camel JBang option can be added to the user configuration, for example to export a simple project + +[source,bash] +---- +camel init foo.yaml +camel config set gav=com.foo:acme:1.0-SNAPSHOT +camel config set runtime=spring-boot +camel config set deps=org.apache.camel.springboot:camel-timer-starter +camel config set camel-spring-boot-version=3.20.1 + +camel export +---- + +User configurations values can be unset via: + +[source,bash] +---- +camel config unset camel-spring-boot-version=3.20.1 +---- + +=== List and get configurations + +User configurations keys can be listed with: + +[source,bash] +---- +camel config list +---- + +Given the configuration in the previous paragraph the ouptut will be: + +[source,bash] +---- +gav +runtime +deps +---- + +In order to get a value given a key, get command can be used: + +[source,bash] +---- +camel config get gav + +com.foo:acme:1.0-SNAPSHOT +---- == Troubleshooting