forked from tektoncd/triggers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes tektoncd#481 Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
- Loading branch information
Showing
5 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## V1Beta1 Task EventListener | ||
|
||
Creates an EventListener that creates a v1beta1 TaskRun. | ||
|
||
### Try it out locally: | ||
|
||
1. Create the service account: | ||
|
||
```shell script | ||
kubectl apply -f examples/role-resources/triggerbinding-roles | ||
kubectl apply -f examples/role-resources/ | ||
``` | ||
|
||
1. Create the V1Beta1 EventListener: | ||
|
||
```shell script | ||
kubectl apply -f examples/v1beta1/v1beta1-listener.yaml | ||
``` | ||
|
||
1. Port forward: | ||
|
||
```shell script | ||
kubectl port-forward \ | ||
"$(kubectl get pod --selector=eventlistener=v1beta1-listener -oname)" \ | ||
8080 | ||
``` | ||
|
||
**Note**: Instead of port forwarding, you can set the | ||
[`serviceType`](https://github.com/tektoncd/triggers/blob/master/docs/eventlisteners.md#serviceType) | ||
to `LoadBalancer` to expose the EventListener with a public IP. | ||
|
||
1. Test by sending the sample payload. | ||
|
||
```shell script | ||
curl -v \ | ||
-H 'Content-Type: application/json' \ | ||
--data "{}" \ | ||
http://localhost:8080 | ||
``` | ||
|
||
The response status code should be `201 Created` | ||
|
||
1. You should see a new TaskRun that got created: | ||
|
||
```shell script | ||
kubectl get taskruns | grep v1beta1-run- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: TriggerTemplate | ||
metadata: | ||
name: v1beta1-task-template | ||
spec: | ||
resourcetemplates: | ||
- apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: v1beta1-run- | ||
spec: | ||
taskSpec: | ||
steps: | ||
- name: "hellothere" | ||
image: ubuntu | ||
script: echo "hello there" | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: EventListener | ||
metadata: | ||
name: v1beta1-task-listener | ||
spec: | ||
# from examples/role-resources/servicaccount.yaml | ||
serviceAccountName: tekton-triggers-example-sa | ||
triggers: | ||
- name: v1beta1-task-trigger | ||
template: | ||
name: v1beta1-task-template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.