Skip to content

Conversation

@nakabonne
Copy link
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1381

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.83%. This pull request does not change code coverage.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "committing"

Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Defining Events"

kind: EventWatcher
spec:
events:
# For those who want to update the manifest file when pushing docker image.
Copy link
Member

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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Member

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).
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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,"

@nakabonne
Copy link
Member Author

Thank you for your review. Could you take a look again when you are free?

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.83%. This pull request does not change code coverage.

@nghialv
Copy link
Member

nghialv commented Jan 18, 2021

Nice.
/lgtm

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.
Copy link
Member

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.
Copy link
Member

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.

@pipecd-bot pipecd-bot removed the lgtm label Jan 18, 2021
@nakabonne
Copy link
Member Author

@khanhtc1202 Thank you! I've fixed the parts pointed out.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.83%. This pull request does not change code coverage.

@khanhtc1202
Copy link
Member

Thank you
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit aa7feea into master Jan 19, 2021
@pipecd-bot pipecd-bot deleted the event-watcher-docs branch January 19, 2021 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support EventWatcher instead of ImageWatcher

5 participants