You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/04/20 09:47:00 UTC

[camel] 02/02: CAMEL-17991: camel-jbang - camel init - download source from github to local

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 665bd3f35a7379f328e7db33200622d655e457e8
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Apr 20 11:46:21 2022 +0200

    CAMEL-17991: camel-jbang - camel init - download source from github to local
---
 .../modules/ROOT/pages/camel-jbang.adoc            | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index 381a9ba5bb2..2a9e70d646c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -150,6 +150,48 @@ Or you can run all files starting with rou*
 camel run https://github.com/apache/camel-k/tree/main/examples/languages/rou*
 ----
 
+=== Downloading routes hosted on GitHub
+
+We have made it easy for Camel JBang to download existing examples from GitHub to local disk,
+which allows for modifying the example and to run locally.
+
+All you need to do is to copy the https link from the web browser.
+For example, you can download the _dependency injection_ example by:
+
+[source,bash]
+----
+camel init https://github.com/apache/camel-kamelets-examples/tree/main/jbang/dependency-injection
+----
+
+Then the files (not sub folders) are downloaded to the current directory.
+The example can then be run locally with:
+
+[source,bash]
+----
+camel run *
+----
+
+You can also run in reload mode, to hot-deploy on source code changes.
+
+[source,bash]
+----
+camel run * --reload
+----
+
+You can also download a single file, such as one of the Camel K examples:
+
+[source,bash]
+----
+camel init https://github.com/apache/camel-k/blob/main/examples/languages/simple.groovy
+----
+
+This is a groovy route, which you can run with (or use `*`):
+
+[source,bash]
+----
+camel run simple.groovy
+----
+
 === Running local Kamelets
 
 You can also use Camel JBang to try local Kamelets, without the need to publish them on Github or package them in a jar.