You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/04/01 16:35:45 UTC

camel git commit: Added camel-git docs to gitbook

Repository: camel
Updated Branches:
  refs/heads/master 6a4caa114 -> b314abf55


Added camel-git docs to gitbook


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b314abf5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b314abf5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b314abf5

Branch: refs/heads/master
Commit: b314abf55ae1d515075f9d73de11381bf6971506
Parents: 6a4caa1
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Apr 1 16:34:54 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Apr 1 16:34:54 2016 +0200

----------------------------------------------------------------------
 components/camel-git/src/main/docs/git.adoc | 111 +++++++++++++++++++++++
 docs/user-manual/en/SUMMARY.md              |   1 +
 2 files changed, 112 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b314abf5/components/camel-git/src/main/docs/git.adoc
----------------------------------------------------------------------
diff --git a/components/camel-git/src/main/docs/git.adoc b/components/camel-git/src/main/docs/git.adoc
new file mode 100644
index 0000000..945c97f
--- /dev/null
+++ b/components/camel-git/src/main/docs/git.adoc
@@ -0,0 +1,111 @@
+[[Git-GitComponent]]
+Git Component
+~~~~~~~~~~~~~
+
+*Available as of Camel 2.16*
+
+The *git:* component allows you to work with a generic Git repository. 
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-git</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+*URI Format*
+
+[source,java]
+-----------------------------------
+git://localRepositoryPath[?options]
+-----------------------------------
+
+[[Git-URIOptions]]
+URI Options
+^^^^^^^^^^^
+
+The producer allows to do operations on a specific repository. +
+The consumer allows consuming commits, tags and branches on a specific
+repository.
+
+
+// component options: START
+The Git component has no options.
+// component options: END
+
+
+// endpoint options: START
+The Git component supports 12 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| localPath | common |  | String | *Required* Local repository path
+| branchName | common |  | String | The branch name to work on
+| password | common |  | String | Remote repository password
+| remotePath | common |  | String | The remote repository path
+| tagName | common |  | String | The tag name to work on
+| username | common |  | String | Remote repository username
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| type | consumer |  | GitType | The consumer type
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| operation | producer |  | String | The operation to do on the repository
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+// endpoint options: END
+
+
+[[Git-MessageHeaders]]
+Message Headers
+^^^^^^^^^^^^^^^
+
+[width="100%",cols="10%,10%,10%,20%,50%",options="header",]
+|=======================================================================
+|Name |Default Value |Type |Context |Description
+
+|CamelGitOperation |`null` |String |Producer |The operation to do on a repository, if not specified as endpoint option
+
+|CamelGitFilename |`null` |String |Producer |The file name in an add operation
+
+|CamelGitCommitMessage |`null` |String |Producer |The commit message related in a commit operation
+
+|CamelGitCommitUsername |`null` |String |Producer |The commit username in a commit operation
+
+|CamelGitCommitEmail |`null` |String |Producer |The commit email in a commit operation
+
+|CamelGitCommitId |`null` |String |Producer |The commit id
+|=======================================================================
+
+[[Git-ProducerExample]]
+Producer Example
+^^^^^^^^^^^^^^^^
+
+Below is an example route of a producer that add a file test.java to a
+local repository, commit it with a specific message on master branch and
+then push it to remote repository.
+
+[source,java]
+--------------------------------------------------------------------------------------------------------------------
+from("direct:start")
+        .setHeader(GitConstants.GIT_FILE_NAME, constant("test.java"))
+        .to("git:///tmp/testRepo?operation=add")
+        .setHeader(GitConstants.GIT_COMMIT_MESSAGE, constant("first commit"))
+        .to("git:///tmp/testRepo?operation=commit")
+        .to("git:///tmp/testRepo?operation=push&remotePath=https://foo.com/test/test.git&username=xxx&password=xxx")
+--------------------------------------------------------------------------------------------------------------------
+
+[[Git-ConsumerExample]]
+Consumer Example
+^^^^^^^^^^^^^^^^
+
+Below is an example route of a consumer that consumes commit:
+
+[source,java]
+---------------------------------------
+from("git:///tmp/testRepo?type=commit")
+                        .to(....)
+---------------------------------------

http://git-wip-us.apache.org/repos/asf/camel/blob/b314abf5/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index fa64210..a81fcfa 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -134,6 +134,7 @@
     * [FTP](ftp.adoc)
     * [Ganglia](ganglia.adoc)
     * [Geocoder](geocoder.adoc)
+    * [Git](git.adoc)
     * [Ironmq](ironmq.adoc)
     * [JMS](jms.adoc)
     * [JMX](jmx.adoc)