Skip to content

Commit

Permalink
Migrate resources to triggers v0.2.0
Browse files Browse the repository at this point in the history
Migrate resources to triggers v0.2.0:
- eventlistener.binding -> bindings
- eventlistener.interceptor -> interceptors
- gjson to JSONPath in bindings
  - select an element from an array

Fixes #183
  • Loading branch information
afrittoli authored and tekton-robot committed Jan 20, 2020
1 parent cf31017 commit 072769b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions tekton/resources/images/image-build-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ spec:
serviceAccountName: release-right-meow
triggers:
- name: trigger
binding:
name: trigger-to-build-and-push-image
bindings:
- name: trigger-to-build-and-push-image
template:
name: build-and-push-image
---
Expand Down
12 changes: 6 additions & 6 deletions tekton/resources/mario-github-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ spec:
- name: buildUUID
value: $(body.taskRun.metadata.labels.prow\.k8s\.io/build-id)
- name: gitURL
value: $(body.taskRun.spec.inputs.resources.#(name=="source").resourceSpec.params.#(name=="url").value)
value: $(body.taskRun.spec.inputs.resources[?(@.name == 'source')].resourceSpec.params[?(@.name == 'url')].value)
- name: gitRevision
value: $(body.taskRun.spec.inputs.resources.#(name=="source").resourceSpec.params.#(name=="revision").value)
value: $(body.taskRun.spec.inputs.resources[?(@.name == 'source')].resourceSpec.params[?(@.name == 'revision')].value)
- name: targetImageResourceName
value: $(body.taskRun.spec.outputs.resources.#(name=="image").resourceRef.name)
value: $(body.taskRun.spec.outputs.resources[?(@.name == 'image')].resourceRef.name)
- name: passedOrFailed
value: $(body.taskRun.status.conditions.#(type=="Succeeded").status)
value: $(body.taskRun.status.conditions[?(@.type == 'Succeeded')].status)
---
apiVersion: tekton.dev/v1alpha1
kind: EventListener
Expand All @@ -25,8 +25,8 @@ spec:
serviceAccountName: mario-listener
triggers:
- name: trigger
binding:
name: trigger-to-comment-github
bindings:
- name: trigger-to-comment-github
template:
name: mario-comment-github
---
Expand Down
17 changes: 9 additions & 8 deletions tekton/resources/mario-image-build-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ spec:
serviceType: LoadBalancer
triggers:
- name: trigger
interceptor:
objectRef:
kind: Service
name: mario
apiVersion: v1
namespace: mario
binding:
name: trigger-to-build-and-push-image
interceptors:
- webhook:
objectRef:
kind: Service
name: mario
apiVersion: v1
namespace: mario
bindings:
- name: trigger-to-build-and-push-image
template:
name: build-and-push-image
---
Expand Down
4 changes: 2 additions & 2 deletions tekton/resources/nightly-release/base/eventlistener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
serviceAccountName: robot
triggers:
- name: cron-trigger
binding:
name: binding
bindings:
- name: binding
template:
name: template
4 changes: 2 additions & 2 deletions tekton/resources/org-permissions/peribolos-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
serviceType: LoadBalancer
triggers:
- name: peribolos-trigger
binding:
name: peribolos-binding
bindings:
- name: peribolos-binding
template:
name: peribolos-template
8 changes: 4 additions & 4 deletions tekton/resources/release/nightly-release-logs-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
- name: namespace
value: $(body.taskRun.metadata.namespace)
- name: bucket
value: $(body.taskRun.spec.outputs.resources.#(name=="bucket").resourceRef.name)
value: $(body.taskRun.spec.outputs.resources[?(@.name == 'bucket')].resourceRef.name)
- name: versionTag
value: $(body.taskRun.spec.inputs.params.#(name=="versionTag").value)
value: $(body.taskRun.spec.inputs.params[?(@.name == 'versionTag')].value)
---
apiVersion: tekton.dev/v1alpha1
kind: EventListener
Expand All @@ -21,8 +21,8 @@ spec:
serviceAccountName: release-right-meow
triggers:
- name: log-collection
binding:
name: publish-images-taskrun-to-release-logs
bindings:
- name: publish-images-taskrun-to-release-logs
template:
name: release-logs
---
Expand Down

0 comments on commit 072769b

Please sign in to comment.