Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ One of `yamlField` or `regex` is required.

| Field | Type | Description | Required |
|-|-|-|-|
| file | string | The path to the file to be updated. | Yes |
| file | string | The relative path from the repository root to the file to be updated. | Yes |
| yamlField | string | The yaml path to the field to be updated. It requires to start with `$` which represents the root element. e.g. `$.foo.bar[0].baz`. | No |
| regex | string | The regex string that specify what should be replaced. The only first capturing group enclosed by `()` will be replaced with the new value. e.g. `host.xz/foo/bar:(v[0-9].[0-9].[0-9])` | No |

Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/user-guide/event-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ spec:
+ version: 0.2.0
```

See [here](https://github.com/pipe-cd/examples/blob/master/.pipe/event-watcher.yaml) for more examples.
See [here](https://github.com/pipe-cd/examples/blob/master/.pipe) for more examples.

## Github Actions
If you're using Github Actions in your CI workflow, [actions-event-register](https://github.com/marketplace/actions/pipecd-register-event) is for you!
Expand Down
9 changes: 9 additions & 0 deletions examples/.pipe/event-watcher-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: pipecd.dev/v1beta1
kind: EventWatcher
spec:
events:
# For those who want to update the deployment config file when releasing a new Helm package.
- name: helm-release
replacements:
- file: kubernetes/helm-remote-chart/.pipe.yaml
yamlField: $.spec.input.helmChart.version
17 changes: 17 additions & 0 deletions examples/.pipe/event-watcher-k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: pipecd.dev/v1beta1
kind: EventWatcher
spec:
events:
# For those who want to update the manifest file when a new docker image was pushed.
- name: image-update
replacements:
- file: kubernetes/simple/deployment.yaml
yamlField: $.spec.template.spec.containers[0].image
# For those who want to identify Events using labels.
- name: image-update
labels:
repoId: repo-1
appName: simple
replacements:
- file: kubernetes/simple/deployment.yaml
yamlField: $.spec.template.spec.containers[0].image
9 changes: 9 additions & 0 deletions examples/.pipe/event-watcher-using-regex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: pipecd.dev/v1beta1
kind: EventWatcher
spec:
events:
# For those who want to update a file using regex
- name: image-update-with-regex
replacements:
- file: kubernetes/simple/deployment.yaml
regex: "image: gcr.io/pipecd/helloworld:(v[0-9].[0-9].[0-9])"
34 changes: 0 additions & 34 deletions examples/.pipe/event-watcher.yaml

This file was deleted.