blob: cce64a7619b901719bf26278b794555014d9f114 [file] [log] [blame]
[[run-from-github]]
= Run from GitHub
It is possible to run integrations from a GitHub repository or Gist with dedicated URL syntax:
== Repository
.Syntax
[source]
----
kamel run github:$user/$repo/$path?branch=$branch
----
As example, running the following command
[source]
----
kamel run github:apache/camel-k/examples/languages/Sample.java
----
is equivalent to:
[source]
----
kamel run https://raw.githubusercontent.com/apache/camel-k/main/examples/languages/Sample.java
----
but does not require to type the full GitHub RAW URL.
Declaring the branch query param is not required and defaults to `master` if not explicit set.
== Gist
.Syntax
[source]
----
kamel run https://gist.github.com/${user-id}/${gist-id}
kamel run gist:${gist-id}
----
camel-k will add any file that is part of the Gist as a source.
As example, assuming there are two files listed as part of a Gist, beans.yaml and routes.yaml, then the following command
[source]
----
kamel run gist:${gist-id}
----
is equivalent to:
[source]
----
kamel run \
https://gist.githubusercontent.com/${user-id}/${gist-id}/raw/${...}/beans.yaml \
https://gist.githubusercontent.com/${user-id}/${gist-id}/raw/${...}/routes.yaml
----
[NOTE]
====
GitHub applies rate limiting to its APIs and as Authenticated requests get a higher rate limit, the camel-k cli honour the env var GITHUB_TOKEN and if it is found, then it is used for GitHub authentication.
====