#kubernetes #pipelines #tekton

app tkn-watch

watch tekton pipelinerun execution

3 releases (breaking)

Uses new Rust 2021

0.3.0 May 9, 2022
0.2.0 May 8, 2022
0.1.0 May 7, 2022

#1615 in Command line utilities

Apache-2.0 and LGPL-3.0

1.5MB
3K SLoC

AsciiDoc 2.5K SLoC Rust 414 SLoC // 0.0% comments BASH 59 SLoC Shell 44 SLoC PowerShell 39 SLoC Elvish 36 SLoC Ruby 29 SLoC // 0.1% comments Go 3 SLoC

codecov Version AUR CICD pre-commit

tkn-watch - watch a PipelineRuns on its way to success or failures

tkn-watch is a simple extension to the tkn command line tool that watches a PipelineRuns and exit with the PipelineRun status.

It mimics the behaviour of GitHub cli run watch command.

Screenshot

tkn-watch screenshot

Demo

https://user-images.githubusercontent.com/98980/167365691-808bcd91-cb8b-4597-b5bd-57f544c2bc5e.mov

Installation

Binaries

Go to the release page and grab the archive or package targeting your platform.

Homebrew

brew tap chmouel/tkn-watch https://github.com/chmouel/tkn-watch
brew install tkn-watch

Crates.io

cargo install tkn-watch

Arch

With your favourite aurhelper for example yay :

yay -S tkn-watch-bin

Docker

docker run -i ghcr.io/chmouel/tkn-watch # don't forget to bind your kubeconfig

Usage

% tkn watch <pipelinerun-name>

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):

tkn watch -l || osascript -e 'display notification "PipelineRun Has Failed :("' && osascript -e 'display notification "PipelineRun Has Succeeded, time to commit again :)"'

Apache-2.0

Authors

Chmouel Boudjnah <@chmouel>

Dependencies

~83MB
~1.5M SLoC