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 2021/12/21 13:57:16 UTC

[camel-kamelets] branch github-commit-source created (now 4d897ff)

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

acosentino pushed a change to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git.


      at 4d897ff  Added Github Commit Source Kamelet - Templates

This branch includes the following new commits:

     new c41b6c8  Added Github Commit Source Kamelet
     new 28d0042  Added Github Commit Source Kamelet
     new 13d965f  Added Github Commit Source Kamelet
     new cbfdbe0  Added Github Commit Source Kamelet - Docs
     new 4d897ff  Added Github Commit Source Kamelet - Templates

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[camel-kamelets] 01/05: Added Github Commit Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit c41b6c8279271d24440a3a7d7fe68ae1daaa4f6e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 14:54:10 2021 +0100

    Added Github Commit Source Kamelet
---
 kamelets/github-commit-source.kamelet.yaml | 85 ++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/kamelets/github-commit-source.kamelet.yaml b/kamelets/github-commit-source.kamelet.yaml
new file mode 100644
index 0000000..95e8d8c
--- /dev/null
+++ b/kamelets/github-commit-source.kamelet.yaml
@@ -0,0 +1,85 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: github-commit-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTggMEMzLjU4IDAgMCAzLjU4IDAgOEMwIDExLjU0IDIuMjkgMTQuNTMgNS40NyAxNS41OUM1Ljg3IDE1LjY2IDYuMDIgMTUuNDIgNi4wMiAxNS4yMUM2LjAyIDE1LjAyIDYuMDEgMTQuMzkgNi4wMSAxMy43MkM0IDE0LjA5IDMuNDggMTMuMjMgMy4zMiAxMi43OEMzLjIzIDEyLjU1IDIuODQgMTEuOD [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "GitHub"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Github Commit Source"
+    description: |-
+      Receive commit From Github.
+    required:
+      - repoName
+      - repoOwner
+      - oauthToken
+      - startingSha
+      - branch
+    type: object
+    properties:
+      repoName:
+        title: Repository Name
+        description: The Github Repository name
+        type: string
+      repoOwner:
+        title: Repository Owner
+        description: The repository owner
+        type: string
+      oauthToken:
+        title: OAuth Token
+        description: Oauth token
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      startingSha:
+        title: Starting SHA
+        description: The SHA from which we want to consume, possible values beginning, last or a specific SHA
+        type: string
+        default: last
+      branch:
+        title: Branch 
+        description: The branch we want to consume commit from
+        type: string
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:github"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "github://commit/{{branch}}"
+      parameters:
+        repoName: "{{repoName}}"
+        repoOwner: "{{repoOwner}}"
+        oauthToken: "{{oauthToken}}"
+        startingSha: "{{startingSha}}"
+      steps:
+      - marshal:
+          json: {}
+      - to: "kamelet:sink"

[camel-kamelets] 03/05: Added Github Commit Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 13d965fde7c1d81a65f1e64f86949715e4e498b6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 14:55:17 2021 +0100

    Added Github Commit Source Kamelet
---
 docs/modules/ROOT/nav.adoc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index d9766e5..cc33cb3 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -53,6 +53,7 @@
 * xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source]
 * xref:ROOT:ftps-sink.adoc[image:kamelets/ftps-sink.svg[] FTPS Sink]
 * xref:ROOT:ftps-source.adoc[image:kamelets/ftps-source.svg[] FTPS Source]
+* xref:ROOT:github-commit-source.adoc[image:kamelets/github-commit-source.svg[] Github Commit Source]
 * xref:ROOT:github-source.adoc[image:kamelets/github-source.svg[] Github Source]
 * xref:ROOT:google-calendar-source.adoc[image:kamelets/google-calendar-source.svg[] Google Calendar Source]
 * xref:ROOT:google-functions-sink.adoc[image:kamelets/google-functions-sink.svg[] Google Functions Sink]

[camel-kamelets] 04/05: Added Github Commit Source Kamelet - Docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit cbfdbe09282c2868ccb9458631f388888d7dc372
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 14:55:25 2021 +0100

    Added Github Commit Source Kamelet - Docs
---
 .../images/kamelets/github-commit-source.svg       |   3 +
 docs/modules/ROOT/pages/github-commit-source.adoc  | 157 +++++++++++++++++++++
 2 files changed, 160 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/github-commit-source.svg b/docs/modules/ROOT/assets/images/kamelets/github-commit-source.svg
new file mode 100644
index 0000000..a8d1174
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/github-commit-source.svg
@@ -0,0 +1,3 @@
+<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7. [...]
+</svg>
diff --git a/docs/modules/ROOT/pages/github-commit-source.adoc b/docs/modules/ROOT/pages/github-commit-source.adoc
new file mode 100644
index 0000000..774bb64
--- /dev/null
+++ b/docs/modules/ROOT/pages/github-commit-source.adoc
@@ -0,0 +1,157 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/github-commit-source.svg[] Github Commit Source
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Receive commit From Github.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `github-commit-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *branch {empty}* *| Branch| The branch we want to consume commit from| string| | 
+| *oauthToken {empty}* *| OAuth Token| Oauth token| string| | 
+| *repoName {empty}* *| Repository Name| The Github Repository name| string| | 
+| *repoOwner {empty}* *| Repository Owner| The repository owner| string| | 
+| *startingSha {empty}* *| Starting SHA| The SHA from which we want to consume, possible values beginning, last or a specific SHA| string| `"last"`| 
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `github-commit-source` Kamelet relies upon the presence of the following dependencies:
+
+- camel:jackson
+- camel:github
+- camel:kamelet 
+
+== Usage
+
+This section describes how you can use the `github-commit-source`.
+
+=== Knative Source
+
+You can use the `github-commit-source` Kamelet as a Knative source by binding it to a Knative object.
+
+.github-commit-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: github-commit-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: github-commit-source
+    properties:
+      branch: "The Branch"
+      oauthToken: "The OAuth Token"
+      repoName: "The Repository Name"
+      repoOwner: "The Repository Owner"
+  sink:
+    ref:
+      kind: Channel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  
+----
+
+==== *Prerequisite*
+
+You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `github-commit-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f github-commit-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind github-commit-source -p "source.branch=The Branch" -p "source.oauthToken=The OAuth Token" -p "source.repoName=The Repository Name" -p "source.repoOwner=The Repository Owner" channel:mychannel
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Source
+
+You can use the `github-commit-source` Kamelet as a Kafka source by binding it to a Kafka topic.
+
+.github-commit-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: github-commit-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: github-commit-source
+    properties:
+      branch: "The Branch"
+      oauthToken: "The OAuth Token"
+      repoName: "The Repository Name"
+      repoOwner: "The Repository Owner"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  
+----
+
+==== *Prerequisites*
+
+* You've installed https://strimzi.io/[Strimzi].
+* You've created a topic named `my-topic` in the current namespace.
+* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `github-commit-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f github-commit-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind github-commit-source -p "source.branch=The Branch" -p "source.oauthToken=The OAuth Token" -p "source.repoName=The Repository Name" -p "source.repoOwner=The Repository Owner" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+== Kamelet source file
+
+https://github.com/apache/camel-kamelets/blob/main/kamelets/github-commit-source.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

[camel-kamelets] 02/05: Added Github Commit Source Kamelet

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 28d0042e17474d7f96d3bad4ca43b84d0ccfa04d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 14:54:49 2021 +0100

    Added Github Commit Source Kamelet
---
 .../kamelets/github-commit-source.kamelet.yaml     | 85 ++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/github-commit-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/github-commit-source.kamelet.yaml
new file mode 100644
index 0000000..95e8d8c
--- /dev/null
+++ b/library/camel-kamelets/src/main/resources/kamelets/github-commit-source.kamelet.yaml
@@ -0,0 +1,85 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: github-commit-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTggMEMzLjU4IDAgMCAzLjU4IDAgOEMwIDExLjU0IDIuMjkgMTQuNTMgNS40NyAxNS41OUM1Ljg3IDE1LjY2IDYuMDIgMTUuNDIgNi4wMiAxNS4yMUM2LjAyIDE1LjAyIDYuMDEgMTQuMzkgNi4wMSAxMy43MkM0IDE0LjA5IDMuNDggMTMuMjMgMy4zMiAxMi43OEMzLjIzIDEyLjU1IDIuODQgMTEuOD [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "GitHub"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Github Commit Source"
+    description: |-
+      Receive commit From Github.
+    required:
+      - repoName
+      - repoOwner
+      - oauthToken
+      - startingSha
+      - branch
+    type: object
+    properties:
+      repoName:
+        title: Repository Name
+        description: The Github Repository name
+        type: string
+      repoOwner:
+        title: Repository Owner
+        description: The repository owner
+        type: string
+      oauthToken:
+        title: OAuth Token
+        description: Oauth token
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      startingSha:
+        title: Starting SHA
+        description: The SHA from which we want to consume, possible values beginning, last or a specific SHA
+        type: string
+        default: last
+      branch:
+        title: Branch 
+        description: The branch we want to consume commit from
+        type: string
+  types:
+    out:
+      mediaType: application/json
+  dependencies:
+  - "camel:jackson"
+  - "camel:github"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "github://commit/{{branch}}"
+      parameters:
+        repoName: "{{repoName}}"
+        repoOwner: "{{repoOwner}}"
+        oauthToken: "{{oauthToken}}"
+        startingSha: "{{startingSha}}"
+      steps:
+      - marshal:
+          json: {}
+      - to: "kamelet:sink"

[camel-kamelets] 05/05: Added Github Commit Source Kamelet - Templates

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch github-commit-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 4d897ff9e84b834bd41f7dd30c8579d7e0689900
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Dec 21 14:55:45 2021 +0100

    Added Github Commit Source Kamelet - Templates
---
 .../camel-k/github-commit-source-binding.yaml       | 21 +++++++++++++++++++++
 .../bindings/core/github-commit-source-binding.yaml | 12 ++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/templates/bindings/camel-k/github-commit-source-binding.yaml b/templates/bindings/camel-k/github-commit-source-binding.yaml
new file mode 100644
index 0000000..3f0600d
--- /dev/null
+++ b/templates/bindings/camel-k/github-commit-source-binding.yaml
@@ -0,0 +1,21 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: github-commit-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: github-commit-source
+    properties:
+      branch: "The Branch"
+      oauthToken: "The OAuth Token"
+      repoName: "The Repository Name"
+      repoOwner: "The Repository Owner"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  
\ No newline at end of file
diff --git a/templates/bindings/core/github-commit-source-binding.yaml b/templates/bindings/core/github-commit-source-binding.yaml
new file mode 100644
index 0000000..a4479eb
--- /dev/null
+++ b/templates/bindings/core/github-commit-source-binding.yaml
@@ -0,0 +1,12 @@
+- route:
+    from:
+      uri: "kamelet:github-commit-source"
+      parameters:
+        branch: "The Branch"
+        oauthToken: "The OAuth Token"
+        repoName: "The Repository Name"
+        repoOwner: "The Repository Owner"
+    steps:
+      - to:
+          uri: "log:info"
+    
\ No newline at end of file