Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #263 from kabanero-io/257-jantley-addtriggers
Browse files Browse the repository at this point in the history
Adding trigger-related doc for 0.5.0
  • Loading branch information
alohr51 authored Jan 27, 2020
2 parents a90b4ab + ea17c9e commit 465907f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
14 changes: 7 additions & 7 deletions ref/general/configuration/tekton-webhooks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
:page-doc-number: 5.0
= Connecting Kabanero to GitHub with Tekton Webhooks

A webhook is an outbound HTTP request that helps you create a relationship between your GitHub repository and a particular URL, in this case a https://github.com/kabanero-io/kabanero-pipelines/blob/master/README.md[Tekton pipeline, window="_blank"]. After you configure the webhook, changes you make in your GitHub repository will trigger the Tekton pipeline and its associated tasks.
A webhook is an outbound HTTP request that helps you create a relationship between your GitHub repository and a particular URL, in this case a https://github.com/kabanero-io/kabanero-pipelines/blob/master/README.md[Kabanero pipeline, window="_blank"]. After you configure the webhook, changes you make in your GitHub repository will trigger the pipeline and its associated tasks.
== Prerequisites
* A GitHub repository
* https://github.com/kabanero-io/kabanero-foundation/tree/master/scripts[Kabanero Foundation, window="_blank"].
** Your Kabanero installation includes an instance of the https://github.com/tektoncd/dashboard#installing-the-latest-release[Tekton Dashboard, window="_blank"] with the https://github.com/tektoncd/experimental/blob/master/webhooks-extension/docs/InstallReleaseBuild.md[Webhooks Extension, window="_blank"] installed.
** Your Kabanero installation includes an instance of the https://github.com/tektoncd/dashboard#installing-the-latest-release[Tekton Dashboard, window="_blank"] with the https://github.com/tektoncd/experimental/blob/master/webhooks-extension/README.md[Webhooks Extension, window="_blank"] and https://github.com/tektoncd/triggers/tree/v0.1.0/docs#tekton-triggers[Tekton Triggers, window="_blank"] installed.
== Create a persistent volume
Tekton pipelines need a persistent volume. If there is no network storage available, create a `hostPath pv`. For more information, see *Creating a persistent volume* in https://github.com/kabanero-io/kabanero-pipelines/blob/master/README.md[Kabanero Pipelines, window="_blank"].
[#gat]
== Generate a GitHub access token.
== Generate a GitHub access token
You need to generate a GitHub personal access token to use for creating the webhook and for accessing the repository source code during PipelineRuns. To generate the token:
. Go to https://github.com/settings/tokens[github.com/settings/tokens, window="_blank"] and click `Generate new token`.
. Check the `admin:repo_hook` option and click `Generate token`. If you are working in a private repository, more options might be required. Check with your administrator for details. *Make sure to save the token to a file since you can't see it after you leave this page.*
== Create secrets.
== Create secrets
If you are working with a private or enterprise GitHub repository, you need to store your access token in a Kubernetes secret. If you are working with a public GitHub repository, you do not need to create a secret for your Tekton dashboard webhook.
. From your Tekton Dashboard, select `Secrets` from the sidebar menu and click `Add Secret`.
Expand All @@ -35,7 +35,7 @@ If you are working with a private or enterprise GitHub repository, you need to s
If you want to push the image to Docker Hub, you need to create a separate secret to connect to Docker Hub. Follow the same procedure but use your Docker Hub username and password. For `Access To:`, select `Docker Registry` from the drop-down list.
== Create a webhook.
== Create a webhook
. From your Tekton Dashboard, select `webhooks` from the sidebar menu and click `Add Webhook`.
. Enter your information in the `Create Webhook` window.
+
Expand Down Expand Up @@ -68,7 +68,7 @@ Select the Docker registry where any built images are pushed. Use the same Docke
. After you complete the necessary information, click `Create`.
== Confirm your webhook.
== Confirm your webhook
. Look for the webhook in your GitHub Repository.
* From your GitHub repository, go to the `settings` tab and select `Webhooks` from the sidebar menu. Look for the webhook you created. Sometimes the webhook initially shows a 504 error icon but after the webhook is used it changes to a green check mark.
Expand All @@ -86,5 +86,5 @@ Your GitHub repo is connected to Kabanero with a webhook. Changes in your code c
You can delete an existing webhook by using your Tekton Dashboard.
. From your Tekton Dashboard, select `webhooks` from the sidebar menu.
. Select the webhook(s) that you want to delete by clicking the box beside the webhook name.
. Select the webhooks that you want to delete by clicking the box beside the webhook name.
. Click `Delete`.
4 changes: 3 additions & 1 deletion ref/general/installation/installing-kabanero-foundation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ spec:

. As a `cluster-admin`, or as a user with `create` and `update` authority to the `kabaneros.kabanero.io` kind, create a `Kabanero` custom resource (CR) instance. A sample `oc apply` command which applies the default instance for this release of Kabanero, including the default collections, is shown when the `install.sh` script finishes running. You can modify the CR instance to include the URL of a custom collection and the GitHub information necessary to administer that collection. For more information on customizing the CR instance, see link:/docs/ref/general/configuration/kabanero-cr-config.html[the Kabanero CR configuration reference].

== After installing
== After installation

**Important:** Due to the addition of Tekton Triggers in Kabanero version 0.5, if you are upgrading to Kabanero version 0.5 from a previous version, you must delete any existing webhooks and create them again. See link:/docs/ref/general/configuration/tekton-webhooks.html[Connecting Kabanero to GitHub with Tekton Webhooks] for instructions on deleting and creating webhooks.

The **Kabanero Console** is installed as part of the install process and is a good next step to go explore information about your Kabanero instance.

Expand Down
11 changes: 11 additions & 0 deletions ref/general/reference/troubleshooting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ at this time; they do not impact the application deployment:
* `error creating GitHub client: error parsing PR number: pulls`
* `IOError: [Errno 2] No such file or directory: '/workspace/pull-request/pr.json'`
== `Failed to create webhook` error
An error creating webhooks will occur when the user selects a pipeline that does not have the associated TriggerTemplate and TriggerBindings when creating a webhook in the extension.
Each pipeline must have a number of Triggers resources for the Webhooks Extension to work properly, as described here: https://github.com/tektoncd/experimental/blob/master/webhooks-extension/docs/GettingStarted.md#pipeline
----
Select the Pipeline in the target Namespace from which a PipelineRun (and accompanying PipelineResources) will be created, as described in the section
'What does the Tekton Dashboard's Webhooks Extension do?', above. Note that you need to have related Tekton Trigger resources installed in the install
namespace (rather than the target namespace), these resources being; a triggertemplate called <pipeline-name>-template and two triggerbindings
<pipeline-name>-push-binding and <pipeline-name>-pullrequest-binding.
----
== `docker push` fails with gateway timeout error
Expand Down

0 comments on commit 465907f

Please sign in to comment.