https://github.com/chmouel/tkn-watch
tkn-watch - watch a PipelineRuns on its way to success or failures
https://github.com/chmouel/tkn-watch
cli rust tekton-pipelines
Last synced: about 1 year ago
JSON representation
tkn-watch - watch a PipelineRuns on its way to success or failures
- Host: GitHub
- URL: https://github.com/chmouel/tkn-watch
- Owner: chmouel
- License: apache-2.0
- Archived: true
- Created: 2022-05-07T12:52:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T11:13:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-11T08:27:20.168Z (over 1 year ago)
- Topics: cli, rust, tekton-pipelines
- Language: Rust
- Homepage:
- Size: 2 MB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://crates.io/crates/tkn-watch) [](https://aur.archlinux.org/packages/tkn-watch-bin) [](https://github.com/chmouel/tkn-watch/actions/workflows/rust.yaml) [](https://github.com/pre-commit/pre-commit)
# tkn-watch - watch a PipelineRuns on its way to success or failures
tkn-watch is a simple extension to the [tkn](https://github.com/tektoncd/cli) command line tool that watches a PipelineRuns and exit with the PipelineRun status.
It mimics the behaviour of GitHub [cli](https://github.com/cli/cli) `run` `watch` command.
## Screenshot

## Demo
## Installation
### [Binaries](https://github.com/chmouel/tkn-watch/releases)
Go to the [release](https://github.com/chmouel/tkn-watch/releases) page and grab the archive or package targeting your platform.
### [Homebrew](https://homebrew.sh)
```shell
brew tap chmouel/tkn-watch https://github.com/chmouel/tkn-watch
brew install tkn-watch
```
### [Crates.io](https://crates.io/crates/tkn-watch)
```shell
cargo install tkn-watch
```
### [Arch](https://aur.archlinux.org/packages/tkn-watch-bin)
With your favourite aurhelper for example [yay](https://github.com/Jguer/yay) :
```shell
yay -S tkn-watch-bin
```
### [Docker](https://github.com/chmouel/tkn-watch/pkgs/container/tkn-watch)
```shell
docker run -i ghcr.io/chmouel/tkn-watch # don't forget to bind your kubeconfig
```
## Usage
```shell
% tkn watch
```
If you don't have `tkn` cli installed you can call the plug-in directly with `tkn-watch`
If you don't specify a PipelineRun it will ask you nicely for a running
Pipelinerun to watch, auto-selecting one if there is only one running.
When you give the flag `-l`/`--last` tkn-watch will use the last PipelineRun started.
You can use the flag `-n` to specify another namespace than the current one.
You can adjust the time to wait between checks with the flag `-r`/`--refresh-seconds`, the default is 3 seconds.
If you don't want a fancy output and just have it reporting quietly success or failure then you can use the `-q`/`--quiet` flag for this.
`tkn watch` exit with the pipelinerun status, so you can do fancy things like (on macOS):
```shell
tkn watch -lq || osascript -e 'display notification "PipelineRun Has Failed :("' && osascript -e 'display notification "PipelineRun Has Succeeded, time to commit again :)"'
```
If you use [pipelines-as-code](https://github.com/openshift-pipelines/pipelines-as-code) it will detect the headers and show which event and sha this PR targets.

## Copyright
[Apache-2.0](./LICENSE)
## Authors
Chmouel Boudjnah <[@chmouel](https://twitter.com/chmouel)>