-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update examples to use v1beta1 by default. - Add an explicit v1alpha1 example. - Use v1beta1 Pipeline types for Params and tests. Fixes #481 Signed-off-by: Dibyo Mukherjee <[email protected]>
- Loading branch information
Showing
33 changed files
with
260 additions
and
173 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## v1alpha1 Task EventListener | ||
|
||
Creates an EventListener that creates a v1alpha1 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 v1alpha1 EventListener: | ||
|
||
```shell script | ||
kubectl apply -f examples/v1alpha1-task/v1alpha1-task-listener.yaml | ||
``` | ||
|
||
1. Port forward: | ||
|
||
```shell script | ||
kubectl port-forward \ | ||
"$(kubectl get pod --selector=eventlistener=v1alpha1-task-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 v1alpha1-task-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: v1alpha1-task-template | ||
spec: | ||
resourcetemplates: | ||
- apiVersion: tekton.dev/v1alpha1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: v1alpha1-task-run- | ||
spec: | ||
taskSpec: | ||
steps: | ||
- name: "hellothere" | ||
image: ubuntu | ||
script: echo "hello there" | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: EventListener | ||
metadata: | ||
name: v1alpha1-task-listener | ||
spec: | ||
# from examples/role-resources/servicaccount.yaml | ||
serviceAccountName: tekton-triggers-example-sa | ||
triggers: | ||
- name: v1alpha1-task-trigger | ||
template: | ||
name: v1alpha1-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
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
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
Oops, something went wrong.