GithubHelp home page GithubHelp logo

tektoncd / cli Goto Github PK

View Code? Open in Web Editor NEW
419.0 419.0 236.0 66.7 MB

A CLI for interacting with Tekton!

License: Apache License 2.0

Go 98.27% Shell 1.42% Makefile 0.25% Dockerfile 0.04% PowerShell 0.02%
cli command-line hacktoberfest pipeline tekton

cli's People

Contributors

16yuki0702 avatar abayer avatar afrittoli avatar anshulvermapatel avatar barthy1 avatar chmouel avatar concaf avatar conky5 avatar danielhelfand avatar dependabot[bot] avatar digglife avatar divyansh42 avatar girishramnani avatar hrishin avatar jbpratt avatar khrm avatar onyiny-ang avatar pierretasci avatar piyush-garg avatar pradeepitm12 avatar pratap0007 avatar pratikjagrut avatar puneetpunamiya avatar rudeigerc avatar savitaashture avatar sthaha avatar vdemeester avatar vinamra28 avatar waveywaves avatar zregvart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

The TaskRun list in the pipelinerun describe has undefined order

The list of TaskRun present in the pipelinerun describe command are appearing in random order. I think they should always appear in the same order.

$ tkn pr desc cli-release-pipeline-run2gjrn
Name:              cli-release-pipeline-run2gjrn
Namespace:         default
Pipeline Ref:      cli-release-pipeline
# […]

Taskruns
NAME                                             STARTED        DURATION     STATUS
cli-release-pipeline-run2gjrn-build-n66sl        19 hours ago   50 seconds   Succeeded
cli-release-pipeline-run2gjrn-lint-twqdk         19 hours ago   22 seconds   Succeeded
cli-release-pipeline-run2gjrn-release-8z6l5      19 hours ago   3 minutes    Succeeded
cli-release-pipeline-run2gjrn-unit-tests-flcth   19 hours ago   1 minute     Succeeded
$ tkn pr desc cli-release-pipeline-run2gjrn
Name:              cli-release-pipeline-run2gjrn
Namespace:         default
Pipeline Ref:      cli-release-pipeline
# […]
Taskruns
NAME                                             STARTED        DURATION     STATUS
cli-release-pipeline-run2gjrn-lint-twqdk         19 hours ago   22 seconds   Succeeded
cli-release-pipeline-run2gjrn-release-8z6l5      19 hours ago   3 minutes    Succeeded
cli-release-pipeline-run2gjrn-unit-tests-flcth   19 hours ago   1 minute     Succeeded
cli-release-pipeline-run2gjrn-build-n66sl        19 hours ago   50 seconds   Succeeded

Display pipelinerun and taskrun logs in realtime using follow mode

Add a feature/flag to display PipelineRuns/TaskRuns logs for a specified pipeline in real-time.

Inputs (Required): PipelineRuns/TaskRuns name to respective logs commands
Output: show logs from the PipelineRuns/TaskRuns to follow logs in real-time

tkn logs pr <pipelinerun-name> -f
tkn logs tr <taskrun-name> -f

Add makefile at the top of the directory

  • if like me you rather press make than go build ./...
  • so we can have a make check which does all the checks we want without
    remembering which tool to launch before submitting PR.
  • so we can have a make release all centralised and not just in @vdemeester
    brain.
  • cause makefile were cool in the late 90s, became lame in the 2000s and are
    cool again with the go and scala hipsters crowd.

PipelineRun details should show the task names

The pipelinerun details shows the taskrun names but not the task names which which makes it difficult to use the -t flag with tkn pr logs to limit the logs displayed:

Taskruns
NAME                                              STARTED          DURATION     STATUS
petclinic-deploy-pipelinerun-lkq7d-build-hwm58    15 minutes ago   3 minutes    Succeeded
petclinic-deploy-pipelinerun-lkq7d-deploy-z7z9w   12 minutes ago   14 seconds   Succeeded

A column should be added to show the task name as well.

The use-case is for a user to be able to run the following

tkn pr describe my-pipelinerun-lkq7d

Find out the task names and then run

tkn pr logs my-pipelinerun-lkq7d -t task-name

RFE: Interactive prompt when asking for choices

It would be nice when asking for multiple choices unless overriden by a CLI switch to have an interactive prompt like the for example the way jenkinx-x/jx is doing.

This is the library used here :

https://github.com/AlecAivazis/survey

An example of multiple choices :

image

In practice this could look like this, when for example we do :

tkn pipelineruns logs

with no options

ask for a namespace (default to current)
ask for a pipelinerun from an interactive multiple choices (default to the only one if there is only one)

if -t is specified with no argument and with a task :

ask for a task from a list of arguments

Create release docs and scripts

We'll need to release 0.1.0 soon, and for that we need to write release docs and scripts

  • using gorelease to auto-publish
  • using Tekton Pipeline to do the release (inspiration from here
  • docs that say : what to execute, when 👼

/assign

Remove the unwanted flags from help note

Expected Behavior

The help menu should not show any unwanted flags.

Actual Behavior

It shows --azure-container-registry-config flag
image

Additional Info

This flag coming from k8s golang dependency.

Add a --template output to tkn

In the spririt of kubectl --template or even like docker's cli :

--format string Pretty-print containers using a Go template

We need a way to output machine readable so that well machine (like the shell
completion for example) can consume it easily.

  1. Reimplement kubectl --template ?
  2. Reimplement a simplier kubectl --template with only the minimal feature
  3. Do like docker --format do which look simple enough for our use case,

/cc @arilivigni @sthaha @vdemeester

Display pipeline-run logs

Add a command to display pipeline runs for a specified pipeline.

Inputs (Required): pipeline-run name
Input (Optional): task name
Output: show logs from the pipeline-run. If the task name is specified, then only logs from that specific task are displayed

It should also be possible to follow logs in real time

Display pipeline run details

Input (Required): name of the pipeline-run

Output: pipeline-run details and relevant logs

  • Name
  • Resources
  • Tasks and their status
  • Pipeline-run total status
  • Time started
  • Duration
  • What triggered the pipeline (in case of git trigger, git commit associated with the pipeline)
  • Status

If the pipeline has fail, the reason for failure should be displayed

Sort pipelineruns based on time started

The pipelinerun list is current sorted on pipelinerun names:

$ tkn pr ls

NAME                      STARTED        DURATION    STATUS
build-pipelinerun-6pj44   2 hours ago    5 minutes   Failed
build-pipelinerun-86crw   2 hours ago    1 minute    Failed
build-pipelinerun-djx29   1 minute ago   ---         Running
build-pipelinerun-gmldx   1 hour ago     5 minutes   Failed
build-pipelinerun-xsl42   1 hour ago     5 minutes   Failed

It should be sorted based on time started instead with latest showing up at the top.

Cancel pipeline run

Input (Required): pipeline-run name

Output: cancel the running pipeline-run

Show failure reason when a pipelinerun fails

The tkn pr describe command does not include any details when a pipeline run fails:

$ tkn pr describe build-pipelinerun-4cp85
Name:              build-pipelinerun-4cp85
Namespace:         pipelines-tutorial
Pipeline Ref:      build-pipeline
Service Account:   pipeline

Status
STARTED          DURATION    STATUS
41 seconds ago   0 seconds   Failed(PipelineInvalidGraph)

Resources
NAME        RESOURCE REF
app-git     petclinic-git
app-image   petclinic-image

Params
No params

Taskruns
No taskrun

While this info is available on the status:

$ kubectl describe pipelinerun build-pipelinerun-4cp85
...
Status:
  Completion Time:  2019-06-05T13:20:32Z
  Conditions:
    Last Transition Time:  2019-06-05T13:20:32Z
    Message:               PipelineRun pipelines-tutorial/build-pipelinerun-4cp85's Pipeline DAG is invalid: couldn't add link between deploy and build-image: Task deploy depends on build-image but build-image wasn't present in Pipeline
    Reason:                PipelineInvalidGraph
    Status:                False
    Type:                  Succeeded
  Start Time:              2019-06-05T13:20:32Z
Events:                    <none>

Fix pedantic warnings on brew formula

If that's even possible with goreleaser output :

% brew audit --strict tektoncd-cli
[...]
chmouel/tektoncd-cli/tektoncd-cli:
* C: 3: col 9: Description shouldn't start with an indefinite article, i.e. "A"
* C: 17: col 1: Trailing whitespace detected.
* C: 20: col 1: Trailing whitespace detected.
* C: 23: col 1: Trailing whitespace detected.
* Use `system "#{bin}/tkn", "--version"` instead of `system "#{bin}/tkn --version"`

/kind bug

Trigger pipeline

Input (Required): pipeline name

Input: pipeline resources (infer values when possible e.g. git from current dir)

Input: pipeline parameters

Output: create a pipeline-run and the resources and print the name of the pipeline-run

Ideally, it should be possible to run a minimal command like tkn trigger foo-pipeline in order to trigger a pipeline with resources being populated automatically

[refactor] Improve list pipelinerun command

At present, the tests for list pipelinerun command are hard to understand. Also, it should to use the new packages and some tets utils in order to bring consistency with other list commands.

Enhance logs failure message in case of a task failing

Expected Behavior

When a Task fails, tkn taskrun logs (or tkn pipelinerun logs) should display something like Step release has failed : some-error-message here.

Actual Behavior

It currently display : failed to get logs for task release : container step-release has failed : Error

2019-06-17-100207

/kind feature

Should PipelineRun describe list the Task in addition (or with) the TaskRun

Currently, tkn pipelinerun describe my-run display the TaskRun attached to the PipelineRun.

This means:

  • The list varies depending on the status of the PipelineRun as it only display the TaskRun that have been created.
  • If the PipelineRun, there is no way to see how many Task(s) succeeded before the failure.

I think we should show the Pipeline Task for the PipelineRun, either merged with the TaskRun part (aka, listing the Task and attaching the TaskRun status to it) or in a separate table

/kind question

cc @siamaksade

Fix log command references in the doc

Expected Behavior

pipelinerun (taskrun) doc should have the link for logs and describe subcommands

Actual Behavior

pipelinerun (taskrun) doc dont have any links for the above subcommands

Display pipeline details

Add a command to display the details of a pipeline

Input: pipeline name
Output: pipeline details and list of last 10 pipeline-runs

The pipeline details include:

  • Name
  • Resources
  • Task names inlined

For each pipeline-run the following details should be printed:

  • Name
  • Time started
  • Duration
  • Status (Succeeded, Failed, Cancelled, Running, Paused etc)

tkn pipelinerun describe should hide serviceaccount if not present

If no ServiceAccount are attached to the PipelineRun, we should hide the information (or display <none>.

Currently it displays :

Name:              cli-release-pipeline-run2gjrn
Namespace:         default
Pipeline Ref:      cli-release-pipeline
Service Account:

Status
STARTED        DURATION    STATUS
19 hours ago   5 minutes   Succeeded

Show a message when no logs available yet

When a pipelinerun is just created and no logs are available, the tkn pipelinerun logs returns silently:

$ tkn pipelinerun logs mapit-build-pipelinerun-1 -f                                                                                                                 
$

It should print out a message instead to say no logs are available yet or something similar.

Highlight logs snippets (like error/traceback or others)

This maybe a far fetched idea but let's try, it would be nice if tkn logs can
go over the logs messages and higlight some patterns. For example if we have a regexp like this :

(^\d+\) .+)|(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)

it would match a java error and color match the right fields.

It would be nice if that include :

  • global rules: shipped as part of tkn
  • local rules: if user wants to add more rules in a config file
  • a way to disable it.

Cancel task run

Input (Required): task-run name

Output: Cancel the running task-run

Short-hand command for latest pipelinerun logs

Quite often a user would want to look at the latest pipelinerun of a certain pipeline. The current flow requires two steps:

  1. fnd out the name of that pipelinerun via tkn pipeline describe or tkn pr ls
  2. see logs using the tkn pr logs [pipelinerun-name] command.

It would be helpful to simplify that by providing a shortcut command that shows the logs for the latest pipelinerun that is started for a given pipeline:

tkn pipeline logs [pipeline-name]

There could also be flags to allow choosing pipelineruns prior to the latest

Add `--watch` features to list commands

tkn should provide the same feature as kubectl get … --watch, aka watching changes for list.

-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded
if no object name is provided.

This applies to the runtime field

  • taskrun
  • pipelinerun

/kind enhancement

Object completions for shell completion

Expected Behavior

% tkn pipelinerun describe [TAB]
pipelinerun1 pipelinerun2e ....

Actual Behavior

completion system don't offer anything else than completion for arguments and keywords, not objects (as which pipelineruns)

Auto completion support for the zsh shell

Expected Behavior

Add zsh shell support for tkn completion SHELL command.

tkn completion SHELL zsh

Actual Behavior

At this moment tkn completion SHELL supports bash shell.

`tkn` should fail in case of invalid subcommands

When a subcommand is invalid but have a flag (here -n) it should still fail, but it currently does not.

Expected Behavior

$ tkn pipeline foo -n pipeline-demo
# […]
$ echo $?
1

Actual Behavior

$ tkn pipeline foo -n pipeline-demo
$ echo $?
0

Add a command for installing Tekton

Installing Tekton Pipelines on a cluster can be simplified using the CLI:

tkn install

The command would configure the cluster (minikube, GCP, OpenShift, etc) and installs Tekton Pipelines.

Commands with no verb specified should default to list

When possible, if there are no verbs specified for a command then it should default to list if it is relevant for that command.

For example the following should show the list of pipelines.

tkn pipeline

Currently it defaults to the -h and prints the help docs.

completion command help message formatting

Expected Behavior

tkn completion -h should display help message like

$ tkn completion -h

This command prints shell completion code which must be evaluated to provide interactive completion

Supported Shells:
- bash

Usage:
tkn completion SHELL [flags]

Examples:

# generate completion code for bash

tkn completion bash > bash_completion.sh
source bash_completion.sh


Flags:
-h, --help   help for completion

Actual Behavior

It shows output somewhat like following

$ tkn completion -h

	This command prints shell completion code which must be evaluated to provide interactive completion

	Supported Shells:
		- bash

Usage:
  tkn completion SHELL [flags]

Examples:

		# generate completion code for bash
		tkn completion bash > bash_completion.sh
		source bash_completion.sh
		

Flags:
  -h, --help   help for completion

List pipelines

Add a command to list pipelines. For each pipeline, the following details should be displayed in addition to the pipeline details:

  • Last pipeline-run name
  • Last pipeline-run time started
  • Last pipeline-run duration
  • Last pipeline-run status

List pipeline runs

Input (Required): pipeline name
Output: list of pipeline-runs for the given pipeline. For each pipeline-run the following details should be printed:

  • Name
  • Time started
  • Duration
  • Status (Succeeded, Failed, Cancelled, Running, Paused etc)

Display task run logs

Input (Required): task-run name

Output: show logs from all the steps in the task-run

Follow mode to show and follow logs in real time

Similar to #5

Command name and description inconsistency

The command name is inconsistent for a pipelinerun instance. It should be in singular form.

Expected Behavior

pipeline    Manage pipelines
pipelinerun Manage pipelineruns

Actual Behavior

pipeline     Manage pipelines
pipelineruns Manage pipelineruns

Add an option to logs to not show the task name on the left

We currently show the task name in blue on the left :

[build-skaffold-app : step-build-and-push] --cache Use cache when building image

which is nice and all but sometime you want to copy and paste nicely the output of the task and have only whatever logs output not something change,

let's have an option like --porcelain (like git porcelain https://stackoverflow.com/questions/6976473/what-does-the-term-porcelain-mean-in-git) to output only the logs and nothing else.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.