Este conteúdo não está disponível no idioma selecionado.
Chapter 3. OpenShift Pipelines tkn reference
Use the tkn CLI to manage pipelines, tasks, pipeline runs, and other OpenShift Pipelines resources from the command line.
3.1. Basic syntax Copiar o linkLink copiado para a área de transferência!
tkn [command or options] [arguments…]
3.2. Global options Copiar o linkLink copiado para a área de transferência!
--help, -h
3.3. Utility commands Copiar o linkLink copiado para a área de transferência!
You can use utility commands in the tkn CLI to manage the CLI environment. These commands allow you to check the version and enable shell prompt completion.
3.3.1. tkn Copiar o linkLink copiado para a área de transferência!
Parent command for tkn CLI.
Example: Display all options
$ tkn
3.3.2. completion [shell] Copiar o linkLink copiado para a área de transferência!
Print shell prompt completion code that you must evaluate to give interactive completion. Supported shells are bash and zsh.
Example: Completion code for the bash shell prompt
$ tkn completion bash
3.3.3. version Copiar o linkLink copiado para a área de transferência!
Print version information of the tkn CLI.
Example: Check the tkn version
$ tkn version
3.4. Pipelines management commands Copiar o linkLink copiado para a área de transferência!
Use the tkn pipeline commands to create, list, start, delete, and describe pipelines from the command line.
3.4.1. pipeline Copiar o linkLink copiado para a área de transferência!
Manage pipelines.
Example: Display help
$ tkn pipeline --help
3.4.2. pipeline delete Copiar o linkLink copiado para a área de transferência!
Delete a pipeline.
Example: Delete a pipeline from a namespace
$ tkn pipeline delete <pipeline_name> -n <namespace_name>
3.4.3. pipeline describe Copiar o linkLink copiado para a área de transferência!
Describe a pipeline.
Example: Describe a pipeline
$ tkn pipeline describe <pipeline_name>
3.4.4. pipeline list Copiar o linkLink copiado para a área de transferência!
Display a list of pipelines.
Example: Display a list of pipelines
$ tkn pipeline list
3.4.5. pipeline logs Copiar o linkLink copiado para a área de transferência!
Display the logs for a specific pipeline.
Example: Stream the live logs for a pipeline
$ tkn pipeline logs -f <pipeline_name>
3.4.6. pipeline start Copiar o linkLink copiado para a área de transferência!
Start a pipeline.
Example: Start a pipeline
$ tkn pipeline start <pipeline_name>
3.5. Pipeline run commands Copiar o linkLink copiado para a área de transferência!
Use the tkn pipelinerun commands to list, describe, cancel, and delete pipeline runs from the command line.
3.5.1. pipelinerun Copiar o linkLink copiado para a área de transferência!
Manage pipeline runs.
Example: Display help
$ tkn pipelinerun -h
3.5.2. pipelinerun cancel Copiar o linkLink copiado para a área de transferência!
Cancel a pipeline run.
Example: Cancel a pipeline run from a namespace
$ tkn pipelinerun cancel <pipeline_run_name> -n <namespace_name>
3.5.3. pipelinerun delete Copiar o linkLink copiado para a área de transferência!
Delete a pipeline run.
Example: Delete pipeline runs from a namespace
$ tkn pipelinerun delete <pipeline_run_name_1> <pipeline_run_name_2> -n <namespace_name>
Example: Delete all pipeline runs from a namespace, except the five most recently executed pipeline runs
$ tkn pipelinerun delete -n <namespace_name> --keep 5
<namespace_name>-
Replace
5with the number of most recently executed pipeline runs you want to retain.
Example: Delete all pipelines
$ tkn pipelinerun delete --all
Starting with Red Hat OpenShift Pipelines 1.6, the tkn pipelinerun delete --all command does not delete any resources that are in the running state.
3.5.4. pipelinerun describe Copiar o linkLink copiado para a área de transferência!
Describe a pipeline run.
Example: Describe a pipeline run in a namespace
$ tkn pipelinerun describe <pipeline_run_name> -n <namespace_name>
3.5.5. pipelinerun list Copiar o linkLink copiado para a área de transferência!
List pipeline runs.
Example: Display a list of pipeline runs in a namespace
$ tkn pipelinerun list -n <namespace_name>
3.5.6. pipelinerun logs Copiar o linkLink copiado para a área de transferência!
Display the logs of a pipeline run.
Example: Display the logs of a pipeline run with all tasks and steps in a namespace
$ tkn pipelinerun logs <pipeline_run_name> -a -n <namespace_name>
3.6. Task management commands Copiar o linkLink copiado para a área de transferência!
Use the tkn task commands to create, list, start, delete, and describe tasks from the command line.
3.6.1. task Copiar o linkLink copiado para a área de transferência!
Manage tasks.
Example: Display help
$ tkn task -h
3.6.2. task delete Copiar o linkLink copiado para a área de transferência!
Delete a task.
Example: Delete tasks from a namespace
$ tkn task delete <task_name_1> <task_name_2> -n <namespace_name>
3.6.3. task describe Copiar o linkLink copiado para a área de transferência!
Describe a task.
Example: Describe a task in a namespace
$ tkn task describe <task_name> -n <namespace_name>
3.6.4. task list Copiar o linkLink copiado para a área de transferência!
List tasks.
Example: List all the tasks in a namespace
$ tkn task list -n <namespace_name>
3.6.5. task start Copiar o linkLink copiado para a área de transferência!
Start a task.
Example: Start a task in a namespace
$ tkn task start <task_name> -s <service_account_name> -n <namespace_name>
3.7. Task run commands Copiar o linkLink copiado para a área de transferência!
Use the tkn taskrun commands to list, describe, cancel, and delete task runs from the command line.
3.7.1. taskrun Copiar o linkLink copiado para a área de transferência!
Manage task runs.
Example: Display help
$ tkn taskrun -h
3.7.2. taskrun cancel Copiar o linkLink copiado para a área de transferência!
Cancel a task run.
Example: Cancel a task run from a namespace
$ tkn taskrun cancel <task_run_name> -n <namespace_name>
3.7.3. taskrun delete Copiar o linkLink copiado para a área de transferência!
Delete a TaskRun.
Example: Delete task runs from a namespace
$ tkn taskrun delete <task_run_name_1> <task_run_name_2> -n <namespace_name>
Example: Delete all but the five most recently executed task runs from a namespace
$ tkn taskrun delete -n <namespace_name> --keep 5
<namespace_name>-
Replace
5with the number of most recently executed task runs you want to retain.
3.7.4. taskrun describe Copiar o linkLink copiado para a área de transferência!
Describe a task run.
Example: Describe a task run in a namespace
$ tkn taskrun describe <task_run_name> -n <namespace_name>
3.7.5. taskrun list Copiar o linkLink copiado para a área de transferência!
List task runs.
Example: List all the task runs in a namespace
$ tkn taskrun list -n <namespace_name>
3.7.6. taskrun logs Copiar o linkLink copiado para a área de transferência!
Display task run logs.
Example: Display live logs for a task run in a namespace
$ tkn taskrun logs -f <task_run_name> -n <namespace_name>
3.8. Pipeline Resource management commands Copiar o linkLink copiado para a área de transferência!
3.8.1. resource Copiar o linkLink copiado para a área de transferência!
Manage Pipeline Resources.
Example: Display help
$ tkn resource -h
3.8.2. resource create Copiar o linkLink copiado para a área de transferência!
Create a Pipeline Resource.
Example: Create a Pipeline Resource in a namespace
$ tkn resource create -n myspace
This is an interactive command that asks for input on the name of the Resource, type of the Resource, and the values based on the type of the Resource.
3.8.3. resource delete Copiar o linkLink copiado para a área de transferência!
Delete a Pipeline Resource.
Example: Delete the myresource Pipeline Resource from a namespace
$ tkn resource delete myresource -n myspace
3.8.4. resource describe Copiar o linkLink copiado para a área de transferência!
Describe a Pipeline Resource.
Example: Describe the myresource Pipeline Resource
$ tkn resource describe myresource -n myspace
3.8.5. resource list Copiar o linkLink copiado para a área de transferência!
List Pipeline Resources.
Example: List all Pipeline Resources in a namespace
$ tkn resource list -n myspace
3.9. Trigger management commands Copiar o linkLink copiado para a área de transferência!
3.9.1. eventlistener Copiar o linkLink copiado para a área de transferência!
Manage EventListeners.
Example: Display help
$ tkn eventlistener -h
3.9.2. eventlistener delete Copiar o linkLink copiado para a área de transferência!
Delete an EventListener.
Example: Delete mylistener1 and mylistener2 EventListeners in a namespace
$ tkn eventlistener delete mylistener1 mylistener2 -n myspace
3.9.3. eventlistener describe Copiar o linkLink copiado para a área de transferência!
Describe an EventListener.
Example: Describe the mylistener EventListener in a namespace
$ tkn eventlistener describe mylistener -n myspace
3.9.4. eventlistener list Copiar o linkLink copiado para a área de transferência!
List EventListeners.
Example: List all the EventListeners in a namespace
$ tkn eventlistener list -n myspace
3.9.5. eventlistener logs Copiar o linkLink copiado para a área de transferência!
Display logs of an EventListener.
Example: Display the logs of the mylistener EventListener in a namespace
$ tkn eventlistener logs mylistener -n myspace
3.9.6. triggerbinding Copiar o linkLink copiado para a área de transferência!
Manage TriggerBindings.
Example: Display TriggerBindings help
$ tkn triggerbinding -h
3.9.7. triggerbinding delete Copiar o linkLink copiado para a área de transferência!
Delete a TriggerBinding.
Example: Delete mybinding1 and mybinding2 TriggerBindings in a namespace
$ tkn triggerbinding delete mybinding1 mybinding2 -n myspace
3.9.8. triggerbinding describe Copiar o linkLink copiado para a área de transferência!
Describe a TriggerBinding.
Example: Describe the mybinding TriggerBinding in a namespace
$ tkn triggerbinding describe mybinding -n myspace
3.9.9. triggerbinding list Copiar o linkLink copiado para a área de transferência!
List TriggerBindings.
Example: List all the TriggerBindings in a namespace
$ tkn triggerbinding list -n myspace
3.9.10. triggertemplate Copiar o linkLink copiado para a área de transferência!
Manage TriggerTemplates.
Example: Display TriggerTemplate help
$ tkn triggertemplate -h
3.9.11. triggertemplate delete Copiar o linkLink copiado para a área de transferência!
Delete a TriggerTemplate.
Example: Delete mytemplate1 and mytemplate2 TriggerTemplates in a namespace
$ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace`
3.9.12. triggertemplate describe Copiar o linkLink copiado para a área de transferência!
Describe a TriggerTemplate.
Example: Describe the mytemplate TriggerTemplate in a namespace
$ tkn triggertemplate describe mytemplate -n `myspace`
3.9.13. triggertemplate list Copiar o linkLink copiado para a área de transferência!
List TriggerTemplates.
Example: List all the TriggerTemplates in a namespace
$ tkn triggertemplate list -n myspace
3.9.14. clustertriggerbinding Copiar o linkLink copiado para a área de transferência!
Manage ClusterTriggerBindings.
Example: Display ClusterTriggerBindings help
$ tkn clustertriggerbinding -h
3.9.15. clustertriggerbinding delete Copiar o linkLink copiado para a área de transferência!
Delete a ClusterTriggerBinding.
Example: Delete myclusterbinding1 and myclusterbinding2 ClusterTriggerBindings
$ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2
3.9.16. clustertriggerbinding describe Copiar o linkLink copiado para a área de transferência!
Describe a ClusterTriggerBinding.
Example: Describe the myclusterbinding ClusterTriggerBinding
$ tkn clustertriggerbinding describe myclusterbinding
3.9.17. clustertriggerbinding list Copiar o linkLink copiado para a área de transferência!
List ClusterTriggerBindings.
Example: List all ClusterTriggerBindings
$ tkn clustertriggerbinding list
3.10. Hub interaction commands Copiar o linkLink copiado para a área de transferência!
Interact with Tekton Hub for resources such as tasks and pipelines.
3.10.1. hub Copiar o linkLink copiado para a área de transferência!
Interact with hub.
Example: Display help
$ tkn hub -h
Example: Interact with a hub API server
$ tkn hub --api-server https://api.hub.tekton.dev
For each example, to get the corresponding sub-commands and flags, run tkn hub <command> --help.
3.10.2. hub downgrade Copiar o linkLink copiado para a área de transferência!
Downgrade an installed resource.
Example: Downgrade the mytask task in the mynamespace namespace to it’s older version
$ tkn hub downgrade task mytask --to version -n mynamespace
3.10.3. hub get Copiar o linkLink copiado para a área de transferência!
Get a resource manifest by its name, kind, catalog, and version.
Example: Get the manifest for a specific version of the myresource pipeline or task from the tekton catalog
$ tkn hub get [pipeline | task] myresource --from tekton --version version
3.10.4. hub info Copiar o linkLink copiado para a área de transferência!
Display information about a resource by its name, kind, catalog, and version.
Example: Display information about a specific version of the mytask task from the tekton catalog
$ tkn hub info task mytask --from tekton --version version
3.10.5. hub install Copiar o linkLink copiado para a área de transferência!
Install a resource from a catalog by its kind, name, and version.
Example: Install a specific version of the mytask task from the tekton catalog in the mynamespace namespace
$ tkn hub install task mytask --from tekton --version version -n mynamespace
3.10.6. hub reinstall Copiar o linkLink copiado para a área de transferência!
Reinstall a resource by its kind and name.
Example: Reinstall a specific version of the mytask task from the tekton catalog in the mynamespace namespace
$ tkn hub reinstall task mytask --from tekton --version version -n mynamespace
3.10.7. hub search Copiar o linkLink copiado para a área de transferência!
Search a resource by a combination of name, kind, and tags.
Example: Search a resource with a tag cli
$ tkn hub search --tags cli
3.10.8. hub upgrade Copiar o linkLink copiado para a área de transferência!
Upgrade an installed resource.
Example: Upgrade the installed mytask task in the mynamespace namespace to a new version
$ tkn hub upgrade task mytask --to version -n mynamespace