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

Commit

Permalink
Merge pull request #44 from kabanero-io/prototype
Browse files Browse the repository at this point in the history
Update README.
  • Loading branch information
hibell authored May 22, 2020
2 parents 2debe50 + 851adbe commit 61df5b8
Showing 1 changed file with 67 additions and 17 deletions.
84 changes: 67 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,17 @@ Note that for our example, there is no match for project1 , while the match for

Follow the instructions here: https://kabanero.io/docs/ref/general/installation/installing-kabanero-foundation.html

#### Change to kabanero project

Change to the project where kabanero is installed. The default is `kabanero`. For example,

```
oc project kabanero
```
#### Create Kabanero CRD with events-operator enabled
Edit and apply the following yaml
Edit and apply the following yaml to use the default stacks and events based pipeline:
```yaml
Expand All @@ -533,7 +541,6 @@ spec:




#### Create Github related secrets

##### API Token
Expand All @@ -546,7 +553,7 @@ If you need to create a new secret, edit and apply the following secret:
apiVersion: v1
kind: Secret
metadata:
name: ghe-https-secret
name: my-github-secret
namespace: kabanero
annotations:
tekton.dev/git-0: https://github.com
Expand All @@ -562,23 +569,63 @@ Note:
- `username`: the user name to login to github. If using an organizational webhook, the user must have permissions to access all repositories in the organization.
- `password`: The github API token for the user.

##### Image registry secret

If you have not yet configured a secret for your Tekton pipeline to access your image registry, edit and apply the following secret:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: my-docker-secret
annotations:
tekton.dev/docker-0: https://index.docker.io
type: kubernetes.io/basic-auth
stringData:
username: <user>
password: <password>
```
Note:
You may optionally associate the secret with service account `kabahero-pipeline` if you want to use it for your pipeline. You may do this via `oc edit sa kabanero-pipeline` add adding the name of the secrets to the end.
- change `https://index.docker.io` to the URL of your image registry.
- Change `<user>` to the user account for the image registry
- Change `<password>` to the password for the user.

##### Update Pipeline Service Account

Associate the secrets you created with your Tekton pipeline service account.
This enables them to be used when running the pipelines.
The default service account is `kabanero-pipeline`.

```
oc edit serviceaccount kabanero-pipeline
```
At the bottom, add the following entries
```yaml
secrets:
- name: my-github-secret
- name: my-docker-secret
```

Save the file when done.

##### Webhook Secret

The webhook secret is the secret you configure on Github, and embedded in each message received from github.
The webhook secret is the secret you configure on Github, and embedded in each webhook message received from github.
It enables the mediator to verify that the message is indeed from github.

Edit and apply the following secret. Change `<my github secret>` to a string of your choosing. You'll provide the same string when configuring the webhook secret on Github.
Edit and apply the following secret. Change `<my-webhook-secret>` to a string of your choosing. You'll provide the same string when configuring the webhook secret on Github.

```
apiVersion: v1
kind: Secret
metadata:
name: ghe-webhook-secret
name: my-webhook-secret
stringData:
secretToken: <my github secret>
secretToken: <my-webhook-secret>
```


Expand All @@ -597,8 +644,8 @@ spec:
createRoute: true
repositories:
- github:
secret: ghe-https-secret
webhookSecret: ghe-webhook-secret
secret: my-github-secret
webhookSecret: my-webhook-secret
mediations:
- name: webhook
selector:
Expand All @@ -617,7 +664,7 @@ spec:
- name: body.webhooks-tekton-insecure-skip-tls-verify
value: "true"
- name: body.webhooks-tekton-local-deploy
value: "false"
value: "true"
- name: body.webhooks-tekton-monitor-dashboard-url
value: <tekton-dashboard>
sendTo: [ "dest" ]
Expand All @@ -630,7 +677,7 @@ Note:
- Ensure `secret` matches the name of the Kubernetes secret that contains the Github API token.
- Ensure `webhookSecret` matches the name of the Kubernetes secret that contains your webhook secret.
- Change `<my-docker-registry>` to the value of the docker registry for your organization, such as `docker.io/myorg`.
- Set `body.webhooks-tekton-local-deploy` to true if you want to deploy the application after build completes successfully. Note: it must remain "false" if you want to use gitops tech preview to deploy the application.
- Ensure `body.webhooks-tekton-local-deploy` is "true" if you want to deploy the application after build completes successfully. Note: it must be "false" if you want to use gitops tech preview to deploy the application.
- set `<tekton-dashboard>` to the URL for your Tekton dashboard.


Expand Down Expand Up @@ -658,7 +705,7 @@ spec:
insecure: true
```

Note that `body["webhooks-kabanero-tekton-listner"]` is a variable generated by the mediator. Its value is the Tekton event listener that best matches the incoming appsody stack version using semantic versioning.
Note that `body["webhooks-kabanero-tekton-listner"]` is a variable generated by the mediator. Its value is the Tekton event listener that best matches the incoming stack version using semantic versioning.

#### Configure webhook on your source repository

Expand All @@ -670,10 +717,13 @@ If you are not working within an enterprise, you may also create per-repository

#### Test webhook

Make a change to an appsody project on github, within the organization that you configured the webhook.
- Initiate a pull request
- Iniitite a merge
- Initiate a tag on master.
Make a change to an Appsody project on github, within the organization that you configured the webhook.

- Create an Appsody project
- Create a new branch.
- Initiate a pull request from the branch: The pipeline performs a build.
- Initiate a merge to master: The pipeline perform a build, and a deploys the application locally if the variable `body.webhooks-tekton-local-deploy` is set to "true" in your webhook.yaml.
- Initiate a tag on master: The pipeline creates a new tag for the image that was previously built. The value of the tag for the image is the same as the value of the tag you supplied when tagging your repository.

#### Kabanero Web hook Processing Flow for Appsody Projects

Expand Down

0 comments on commit 61df5b8

Please sign in to comment.