-
Notifications
You must be signed in to change notification settings - Fork 208
Add docs for Event watcher #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| To enable [EventWatcher](/docs/user-guide/event-watcher/), you have to configure your piped at first. | ||
|
|
||
| ### [require] Grant write permission | ||
| The [SSH key used by Piped](/docs/operator-manual/piped/configuration-reference/#git) must be a key with write-access because Event watcher automates the deployment flow by commitng and pushing to your git repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "committing"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: because piped needs to commit and push to your git repository when any incoming event matches.
|
|
||
| To enable [EventWatcher](/docs/user-guide/event-watcher/), you have to configure your piped at first. | ||
|
|
||
| ### [require] Grant write permission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"required"
| 1. define which values in which files should be updated when a new Event found. | ||
| 1. integrate a step to push an Event to the control-plane using `pipectl` into your CI workflow. | ||
|
|
||
| ### 1. Define Events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Defining Events"
examples/.pipe/event-watcher.yaml
Outdated
| kind: EventWatcher | ||
| spec: | ||
| events: | ||
| # For those who want to update the manifest file when pushing docker image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"when a new docker image was pushed"
| And if you want to push Events continuously, we highly recommend integrating a step for that into your CI workflow. | ||
|
|
||
| According to [this guide](http://localhost:1313/docs/user-guide/command-line-tool/#installation), you first install it on your CI system or where you want to run. | ||
| And then you grab the API key for the control-plane according to [this guide](http://localhost:1313/docs/user-guide/command-line-tool/#authentication). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove: "http://localhost:1313"
| According to [this guide](http://localhost:1313/docs/user-guide/command-line-tool/#installation), you first install it on your CI system or where you want to run. | ||
| And then you grab the API key for the control-plane according to [this guide](http://localhost:1313/docs/user-guide/command-line-tool/#authentication). | ||
|
|
||
| Once you're all set up, now all we need to do is to execute a command like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Once you're all set up, pushing a new Event to PipeCD by the following command:"
| + image: gcr.io/pipecd/helloworld:v0.2.0 | ||
| ``` | ||
|
|
||
| NOTE: Keep in mind that it will take a little while because Piped checks if a new Event exists by periodically issuing a request to the control-plane. You can set its interval according to [here](/docs/operator-manual/piped/configuring-event-watcher/#optional-settings-for-watcher). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Keep in mind that it may take a little while because Piped periodically fetches the new events from the control-plane check."
"You can change its interval"
| To register a new value corresponding to Event such as the above in the control-plane, you need to perform `pipectl`. | ||
| And if you want to push Events continuously, we highly recommend integrating a step for that into your CI workflow. | ||
|
|
||
| According to [this guide](http://localhost:1313/docs/user-guide/command-line-tool/#installation), you first install it on your CI system or where you want to run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove: https://localhost:1313
|
|
||
| ### 2. Pushing an Event with `pipectl` | ||
| To register a new value corresponding to Event such as the above in the control-plane, you need to perform `pipectl`. | ||
| And if you want to push Events continuously, we highly recommend integrating a step for that into your CI workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove "if you want to push Events continuously,"
|
Thank you for your review. Could you take a look again when you are free? |
|
Nice. |
| It brings benefits quite a bit, but it can be painful to manually update them every time in some cases (e.g. continuous deployment to your development environment for debugging, the latest prerelease to the staging environment). | ||
|
|
||
| If you're experiencing any of the above pains, Event watcher is for you. | ||
| Event watcher works as a helper facility to seamlessly link CI and CD. This feature lets you automatically update files managed by your Piped when an arbitrary event occurs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits, when an arbitrary event has occurred.
| 1. integrate a step to push an Event to the control-plane using `pipectl` into your CI workflow. | ||
|
|
||
| ### 1. Defining Events | ||
| Prepare EventWatcher files placed at the `.pipe/` directory at the root of the Git repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits,
Prepare EventWatcher configuration files under the .pipe/ directory at the root (level) of your Git repository.
|
@khanhtc1202 Thank you! I've fixed the parts pointed out. |
|
Thank you |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1381
Does this PR introduce a user-facing change?: