From 6dfcc306adb13d4e6287ca0d43bb14bfc8648c53 Mon Sep 17 00:00:00 2001 From: Andrea Hoffer Date: Tue, 4 Aug 2020 23:02:01 -0400 Subject: [PATCH] Separating command and output for tkn CLI docs --- .../op-installing-tkn-on-linux-using-rpm.adoc | 7 +++++++ modules/op-installing-tkn-on-linux.adoc | 2 ++ modules/op-installing-tkn-on-macos.adoc | 1 + modules/op-installing-tkn-on-windows.adoc | 1 + modules/op-tkn-clustertask-management.adoc | 5 +++++ modules/op-tkn-condition-management.adoc | 4 ++++ modules/op-tkn-enabling-tab-completion.adoc | 2 ++ modules/op-tkn-pipeline-management.adoc | 7 +++++++ modules/op-tkn-pipeline-resource-management.adoc | 5 +++++ modules/op-tkn-pipeline-run.adoc | 8 +++++++- modules/op-tkn-task-management.adoc | 7 +++++++ modules/op-tkn-task-run.adoc | 6 ++++++ modules/op-tkn-trigger-management.adoc | 16 ++++++++++++++++ modules/op-tkn-utility-commands.adoc | 11 +++++++---- 14 files changed, 77 insertions(+), 5 deletions(-) diff --git a/modules/op-installing-tkn-on-linux-using-rpm.adoc b/modules/op-installing-tkn-on-linux-using-rpm.adoc index b62ce26090..6c10c7fed3 100644 --- a/modules/op-installing-tkn-on-linux-using-rpm.adoc +++ b/modules/op-installing-tkn-on-linux-using-rpm.adoc @@ -17,42 +17,49 @@ For {op-system-base-full} version 8, you can install the {pipelines-title} CLI ( . Register with Red Hat Subscription Manager: + +[source,terminal] ---- # subscription-manager register ---- . Pull the latest subscription data: + +[source,terminal] ---- # subscription-manager refresh ---- . List the available subscriptions: + +[source,terminal] ---- # subscription-manager list --available --matches '*pipelines*' ---- . In the output for the previous command, find the pool ID for your {product-title} subscription and attach the subscription to the registered system: + +[source,terminal] ---- # subscription-manager attach --pool= ---- . Enable the repositories required by {pipelines-title}: + +[source,terminal] ---- # subscription-manager repos --enable="pipelines-1.0-for-rhel-8-x86_64-rpms" ---- . Install the `openshift-pipelines-client` package: + +[source,terminal] ---- # yum install openshift-pipelines-client ---- After you install the CLI, it is available using the `tkn` command: +[source,terminal] ---- $ tkn version ---- diff --git a/modules/op-installing-tkn-on-linux.adoc b/modules/op-installing-tkn-on-linux.adoc index 931c2e86e2..1f83cfeed3 100644 --- a/modules/op-installing-tkn-on-linux.adoc +++ b/modules/op-installing-tkn-on-linux.adoc @@ -14,6 +14,7 @@ For Linux distributions, you can download the CLI directly as a `tar.gz` archive . Unpack the archive: + +[source,terminal] ---- $ tar xvzf ---- @@ -22,6 +23,7 @@ $ tar xvzf . To check your `PATH`, run: + +[source,terminal] ---- $ echo $PATH ---- diff --git a/modules/op-installing-tkn-on-macos.adoc b/modules/op-installing-tkn-on-macos.adoc index 4b6cc1fa55..2c286be2d2 100644 --- a/modules/op-installing-tkn-on-macos.adoc +++ b/modules/op-installing-tkn-on-macos.adoc @@ -18,6 +18,7 @@ For macOS, the `tkn` CLI is provided as a `tar.gz` archive. . To check your `PATH`, open a terminal window and run: + +[source,terminal] ---- $ echo $PATH ---- diff --git a/modules/op-installing-tkn-on-windows.adoc b/modules/op-installing-tkn-on-windows.adoc index 6ce998486e..600c578f07 100644 --- a/modules/op-installing-tkn-on-windows.adoc +++ b/modules/op-installing-tkn-on-windows.adoc @@ -18,6 +18,7 @@ For Windows, the `tkn` CLI is provided as a `zip` archive. . To check your `PATH`, open the command prompt and run the command: + +[source,terminal] ---- C:\> path ---- diff --git a/modules/op-tkn-clustertask-management.adoc b/modules/op-tkn-clustertask-management.adoc index a8911bd3b1..3cf38ebb05 100644 --- a/modules/op-tkn-clustertask-management.adoc +++ b/modules/op-tkn-clustertask-management.adoc @@ -9,6 +9,7 @@ Manage ClusterTasks. .Example: Display help +[source,terminal] ---- $ tkn clustertask --help ---- @@ -17,6 +18,7 @@ $ tkn clustertask --help Delete a ClusterTask resource in a cluster. .Example: Delete `mytask1` and `mytask2` ClusterTasks +[source,terminal] ---- $ tkn clustertask delete mytask1 mytask2 ---- @@ -25,6 +27,7 @@ $ tkn clustertask delete mytask1 mytask2 Describe a ClusterTask. .Example: Describe the `mytask` ClusterTask +[source,terminal] ---- $ tkn clustertask describe mytask1 ---- @@ -33,6 +36,7 @@ $ tkn clustertask describe mytask1 List ClusterTasks. .Example: List ClusterTasks +[source,terminal] ---- $ tkn clustertask list ---- @@ -40,6 +44,7 @@ $ tkn clustertask list Start ClusterTasks. .Example: Start the `mytask` ClusterTask +[source,terminal] ---- $ tkn clustertask start mytask ---- diff --git a/modules/op-tkn-condition-management.adoc b/modules/op-tkn-condition-management.adoc index 2c948e372f..85de7af823 100644 --- a/modules/op-tkn-condition-management.adoc +++ b/modules/op-tkn-condition-management.adoc @@ -9,6 +9,7 @@ Manage Conditions. .Example: Display help +[source,terminal] ---- $ tkn condition --help ---- @@ -17,6 +18,7 @@ $ tkn condition --help Delete a Condition. .Example: Delete the `mycondition1` Condition from a namespace +[source,terminal] ---- $ tkn condition delete mycondition1 -n myspace ---- @@ -25,6 +27,7 @@ $ tkn condition delete mycondition1 -n myspace Describe a Condition. .Example: Describe the `mycondition1` Condition in a namespace +[source,terminal] ---- $ tkn condition describe mycondition1 -n myspace ---- @@ -33,6 +36,7 @@ $ tkn condition describe mycondition1 -n myspace List Conditions. .Example: List Conditions in a namespace +[source,terminal] ---- $ tkn condition list -n myspace ---- diff --git a/modules/op-tkn-enabling-tab-completion.adoc b/modules/op-tkn-enabling-tab-completion.adoc index 4c52b8159f..99fcfa7280 100644 --- a/modules/op-tkn-enabling-tab-completion.adoc +++ b/modules/op-tkn-enabling-tab-completion.adoc @@ -18,12 +18,14 @@ The following procedure enables tab completion for Bash. . Save the Bash completion code to a file: + +[source,terminal] ---- $ tkn completion bash > tkn_bash_completion ---- . Copy the file to `/etc/bash_completion.d/`: + +[source,terminal] ---- $ sudo cp tkn_bash_completion /etc/bash_completion.d/ ---- diff --git a/modules/op-tkn-pipeline-management.adoc b/modules/op-tkn-pipeline-management.adoc index d8fb73a7a3..0d183f2f8e 100644 --- a/modules/op-tkn-pipeline-management.adoc +++ b/modules/op-tkn-pipeline-management.adoc @@ -9,6 +9,7 @@ Manage Pipelines. .Example: Display help +[source,terminal] ---- $ tkn pipeline --help ---- @@ -17,6 +18,7 @@ $ tkn pipeline --help Create a Pipeline. .Example: Create a Pipeline defined by the `mypipeline.yaml` file in a namespace +[source,terminal] ----- $ tkn pipeline create -f mypipeline.yaml -n myspace ----- @@ -26,6 +28,7 @@ $ tkn pipeline create -f mypipeline.yaml -n myspace Delete a Pipeline. .Example: Delete the `mypipeline` Pipeline from a namespace +[source,terminal] ---- $ tkn pipeline delete mypipeline -n myspace ---- @@ -34,6 +37,7 @@ $ tkn pipeline delete mypipeline -n myspace Describe a Pipeline. .Example: Describe `mypipeline` Pipeline +[source,terminal] ---- $ tkn pipeline describe mypipeline ---- @@ -42,6 +46,7 @@ $ tkn pipeline describe mypipeline List Pipelines. .Example: Display a list of Pipelines +[source,terminal] ----- $ tkn pipeline list ----- @@ -50,6 +55,7 @@ $ tkn pipeline list Display Pipeline logs for a specific Pipeline. .Example: Stream live logs for the `mypipeline` Pipeline +[source,terminal] ---- $ tkn pipeline logs -f mypipeline ---- @@ -58,6 +64,7 @@ $ tkn pipeline logs -f mypipeline Start a Pipeline. .Example: Start `mypipeline` Pipeline +[source,terminal] ---- $ tkn pipeline start mypipeline ---- diff --git a/modules/op-tkn-pipeline-resource-management.adoc b/modules/op-tkn-pipeline-resource-management.adoc index d006bf6ed7..acdea005b9 100644 --- a/modules/op-tkn-pipeline-resource-management.adoc +++ b/modules/op-tkn-pipeline-resource-management.adoc @@ -9,6 +9,7 @@ Manage Pipeline Resources. .Example: Display help +[source,terminal] ---- $ tkn resource -h ---- @@ -17,6 +18,7 @@ $ tkn resource -h Create a Pipeline Resource. .Example: Create Pipeline Resource defined by the `myresource.yaml` file in a namespace +[source,terminal] ---- $ tkn resource create -f myresource.yaml -n myspace ---- @@ -25,6 +27,7 @@ $ tkn resource create -f myresource.yaml -n myspace Delete a Pipeline Resource. .Example: Delete the `myresource` Pipeline Resource from a namespace +[source,terminal] ---- $ tkn resource delete myresource -n myspace ---- @@ -33,6 +36,7 @@ $ tkn resource delete myresource -n myspace Describe a Pipeline Resource. .Example: Describe the `myresource` Pipeline Resource +[source,terminal] ---- $ tkn resource describe myresource -n myspace ---- @@ -40,6 +44,7 @@ $ tkn resource describe myresource -n myspace List Pipeline Resources. .Example: List all Pipeline Resources in a namespace +[source,terminal] ---- $ tkn resource list -n myspace ---- diff --git a/modules/op-tkn-pipeline-run.adoc b/modules/op-tkn-pipeline-run.adoc index 86e44d6d98..f03330771f 100644 --- a/modules/op-tkn-pipeline-run.adoc +++ b/modules/op-tkn-pipeline-run.adoc @@ -10,6 +10,7 @@ Manage PipelineRuns. .Example: Display help +[source,terminal] ---- $ tkn pipelinerun -h ---- @@ -18,6 +19,7 @@ $ tkn pipelinerun -h Cancel a PipelineRun. .Example: Cancel the `mypipelinerun` PipelineRun from a namespace +[source,terminal] ---- $ tkn pipelinerun cancel mypipelinerun -n myspace ---- @@ -26,6 +28,7 @@ $ tkn pipelinerun cancel mypipelinerun -n myspace Delete a PipelineRun. .Example: Delete PipelineRuns from a namespace +[source,terminal] ---- $ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace ---- @@ -34,14 +37,16 @@ $ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace Describe a PipelineRun. .Example: Describe the `mypipelinerun` PipelineRun in a namespace +[source,terminal] ---- -tkn pipelinerun describe mypipelinerun -n myspace +$ tkn pipelinerun describe mypipelinerun -n myspace ---- == pipelinerun list List PipelineRuns. .Example: Display a list of PipelineRuns in a namespace +[source,terminal] ---- $ tkn pipelinerun list -n myspace ---- @@ -50,6 +55,7 @@ $ tkn pipelinerun list -n myspace Display the logs of a PipelineRun. .Example: Display the logs of the `mypipelinerun` PipelineRun with all tasks and steps in a namespace +[source,terminal] ---- $ tkn pipelinerun logs mypipelinerun -a -n myspace ---- diff --git a/modules/op-tkn-task-management.adoc b/modules/op-tkn-task-management.adoc index 7e079bb9de..e27a6115cc 100644 --- a/modules/op-tkn-task-management.adoc +++ b/modules/op-tkn-task-management.adoc @@ -9,6 +9,7 @@ Manage Tasks. .Example: Display help +[source,terminal] ---- $ tkn task -h ---- @@ -17,6 +18,7 @@ $ tkn task -h Create a Task. .Example: Create a Task defined by the `mytask.yaml` file in a namespace +[source,terminal] ---- $ tkn task create -f mytask.yaml -n myspace ---- @@ -25,6 +27,7 @@ $ tkn task create -f mytask.yaml -n myspace Delete a Task. .Example: Delete `mytask1` and `mytask2` Tasks from a namespace +[source,terminal] ---- $ tkn task delete mytask1 mytask2 -n myspace ---- @@ -33,6 +36,7 @@ $ tkn task delete mytask1 mytask2 -n myspace Describe a Task. .Example: Describe the `mytask` Task in a namespace +[source,terminal] ---- $ tkn task describe mytask -n myspace ---- @@ -41,6 +45,7 @@ $ tkn task describe mytask -n myspace List Tasks. .Example: List all the Tasks in a namespace +[source,terminal] ---- $ tkn task list -n myspace ---- @@ -49,6 +54,7 @@ $ tkn task list -n myspace Display Task logs. .Example: Display logs for the `mytaskrun` TaskRun of the `mytask` Task +[source,terminal] ---- $ tkn task logs mytask mytaskrun -n myspace ---- @@ -57,6 +63,7 @@ $ tkn task logs mytask mytaskrun -n myspace Start a Task. .Example: Start the `mytask` Task in a namespace +[source,terminal] ---- $ tkn task start mytask -s -n myspace ---- diff --git a/modules/op-tkn-task-run.adoc b/modules/op-tkn-task-run.adoc index 657fd41ad8..a5f195b698 100644 --- a/modules/op-tkn-task-run.adoc +++ b/modules/op-tkn-task-run.adoc @@ -9,6 +9,7 @@ Manage TaskRuns. .Example: Display help +[source,terminal] ---- $ tkn taskrun -h ---- @@ -17,6 +18,7 @@ $ tkn taskrun -h Cancel a TaskRun. .Example: Cancel the `mytaskrun` TaskRun from a namespace +[source,terminal] ---- $ tkn taskrun cancel mytaskrun -n myspace ---- @@ -25,6 +27,7 @@ $ tkn taskrun cancel mytaskrun -n myspace Delete a TaskRun. .Example: Delete `mytaskrun1` and `mytaskrun2` TaskRuns from a namespace +[source,terminal] ---- $ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace ---- @@ -33,6 +36,7 @@ $ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace Describe a TaskRun. .Example: Describe the `mytaskrun` TaskRun in a namespace +[source,terminal] ---- $ tkn taskrun describe mytaskrun -n myspace ---- @@ -41,6 +45,7 @@ $ tkn taskrun describe mytaskrun -n myspace List TaskRuns. .Example: List all TaskRuns in a namespace +[source,terminal] ---- $ tkn taskrun list -n myspace ---- @@ -51,6 +56,7 @@ Display TaskRun logs. .Example: Display live logs for the `mytaskrun` TaskRun in a namespace +[source,terminal] ---- $ tkn taskrun logs -f mytaskrun -n myspace ---- diff --git a/modules/op-tkn-trigger-management.adoc b/modules/op-tkn-trigger-management.adoc index 4e20a06f86..e27f4dade9 100644 --- a/modules/op-tkn-trigger-management.adoc +++ b/modules/op-tkn-trigger-management.adoc @@ -9,6 +9,7 @@ Manage EventListeners. .Example: Display help +[source,terminal] ---- $ tkn eventlistener -h ---- @@ -17,6 +18,7 @@ $ tkn eventlistener -h Delete an EventListener. .Example: Delete `mylistener1` and `mylistener2` EventListeners in a namespace +[source,terminal] ---- $ tkn eventlistener delete mylistener1 mylistener2 -n myspace ---- @@ -24,6 +26,7 @@ $ tkn eventlistener delete mylistener1 mylistener2 -n myspace Describe an EventListener. .Example: Describe the `mylistener` EventListener in a namespace +[source,terminal] ---- $ tkn eventlistener describe mylistener -n myspace ---- @@ -32,6 +35,7 @@ $ tkn eventlistener describe mylistener -n myspace List EventListeners. .Example: List all the EventListeners in a namespace +[source,terminal] ---- $ tkn eventlistener list -n myspace ---- @@ -40,6 +44,7 @@ $ tkn eventlistener list -n myspace Manage TriggerBindings. .Example: Display TriggerBindings help +[source,terminal] ---- $ tkn triggerbinding -h ---- @@ -48,6 +53,7 @@ $ tkn triggerbinding -h Delete a TriggerBinding. .Example: Delete `mybinding1` and `mybinding2` TriggerBindings in a namespace +[source,terminal] ---- $ tkn triggerbinding delete mybinding1 mybinding2 -n myspace ---- @@ -55,6 +61,7 @@ $ tkn triggerbinding delete mybinding1 mybinding2 -n myspace Describe a TriggerBinding. .Example: Describe the `mybinding` TriggerBinding in a namespace +[source,terminal] ---- $ tkn triggerbinding describe mybinding -n myspace ---- @@ -63,6 +70,7 @@ $ tkn triggerbinding describe mybinding -n myspace List TriggerBindings. .Example: List all the TriggerBindings in a namespace +[source,terminal] ---- $ tkn triggerbinding list -n myspace ---- @@ -71,6 +79,7 @@ $ tkn triggerbinding list -n myspace Manage TriggerTemplates. .Example: Display TriggerTemplate help +[source,terminal] ---- $ tkn triggertemplate -h ---- @@ -78,6 +87,7 @@ $ tkn triggertemplate -h Delete a TriggerTemplate. .Example: Delete `mytemplate1` and `mytemplate2` TriggerTemplates in a namespace +[source,terminal] ---- $ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace` ---- @@ -85,6 +95,7 @@ $ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace` Describe a TriggerTemplate. .Example: Describe the `mytemplate` TriggerTemplate in a namespace +[source,terminal] ---- $ tkn triggertemplate describe mytemplate -n `myspace` ---- @@ -93,6 +104,7 @@ $ tkn triggertemplate describe mytemplate -n `myspace` List TriggerTemplates. .Example: List all the TriggerTemplates in a namespace +[source,terminal] ---- $ tkn triggertemplate list -n myspace ---- @@ -100,6 +112,7 @@ $ tkn triggertemplate list -n myspace Manage ClusterTriggerBindings. .Example: Display ClusterTriggerBindings help +[source,terminal] ---- $ tkn clustertriggerbinding -h ---- @@ -108,6 +121,7 @@ $ tkn clustertriggerbinding -h Delete a ClusterTriggerBinding. .Example: Delete `myclusterbinding1` and `myclusterbinding2` ClusterTriggerBindings +[source,terminal] ---- $ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2 ---- @@ -115,6 +129,7 @@ $ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2 Describe a ClusterTriggerBinding. .Example: Describe the `myclusterbinding` ClusterTriggerBinding +[source,terminal] ---- $ tkn clustertriggerbinding describe myclusterbinding ---- @@ -123,6 +138,7 @@ $ tkn clustertriggerbinding describe myclusterbinding List ClusterTriggerBindings. .Example: List all ClusterTriggerBindings +[source,terminal] ---- $ tkn clustertriggerbinding list ---- diff --git a/modules/op-tkn-utility-commands.adoc b/modules/op-tkn-utility-commands.adoc index 5ad3faf500..9daff0363b 100644 --- a/modules/op-tkn-utility-commands.adoc +++ b/modules/op-tkn-utility-commands.adoc @@ -9,14 +9,16 @@ Parent command for `tkn` CLI. .Example: Display all options ------ +[source,terminal] +---- $ tkn ------ +---- == completion [shell] Print shell completion code which must be evaluated to provide interactive completion. Supported shells are `bash` and `zsh`. .Example: Completion code for `bash` shell +[source,terminal] ---- $ tkn completion bash ---- @@ -25,6 +27,7 @@ $ tkn completion bash Print version information of the `tkn` CLI. .Example: Check the `tkn` version ------ +[source,terminal] +---- $ tkn version ------ +----