Skip to content

Commit

Permalink
Add docs for pipectl event register --contexts on the event watcher u…
Browse files Browse the repository at this point in the history
…sage page (#5299)

* Add docs for pipectl event register --contexts on the event watcher usage page

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Fix docs

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* Fix command

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

---------

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
  • Loading branch information
ffjlabo authored and pipecd-bot committed Nov 7, 2024
1 parent 310b7d2 commit d99e92d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/content/en/docs-dev/user-guide/command-line-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ pipectl event register \
--data=gcr.io/pipecd/example:v0.1.0
```

See more on [usage of Event Watcher](./event-watcher.md).

### Encrypting the data you want to use when deploying

Encrypt the plaintext entered either in stdin or via the `--input-file` flag.
Expand Down
32 changes: 32 additions & 0 deletions docs/content/en/docs-dev/user-guide/event-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,38 @@ pipectl event register \

Note that it is considered a match only when labels are an exact match.

### [optional] Using contexts

You can also attach additional metadata to the event.
This information can be added as a trailer to the git commit when Event Watcher using the GIT_UPDATE handler.
This can be useful when attaching information from the source code repository to the manifest repository.

For example, you can attach the source code commit link to the manifest repository.

```bash
pipectl event register \
--address=CONTROL_PLANE_API_ADDRESS \
--api-key=API_KEY \
--name=sample \
--data=gcr.io/pipecd/helloworld:v0.48.0 \
--contexts Source-Commit-Hash=xxxxxxx,Source-Commit-URL=https://github.com/pipe-cd/pipecd/commit/xxxxxxx
```

```bash
# In manifest repository
$ git show
commit ff46cdc9a3ce87a9a66436269251a4870ac55183 (HEAD -> main, origin/main, origin/HEAD)
Author: ffjlabo <pipecd.dev@gmail.com>
Date: Wed Oct 30 16:56:36 2024 +0900
Replace values with "gcr.io/pipecd/helloworld:v0.48.0" set by Event "simple"
Source-Commit-Hash: xxxxxxx
Source-Commit-URL: https://github.com/pipe-cd/pipecd/commit/xxxxxxx
```

![](/images/event-watcher-contexts.png)

## Examples
Suppose you want to update your configuration file after releasing a new Helm chart.

Expand Down
Binary file added docs/static/images/event-watcher-contexts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d99e92d

Please sign in to comment.