Skip to content

Commit

Permalink
update to tkn 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhelfand committed Nov 12, 2019
1 parent fe9ed0a commit 10bf2f1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .workshop/build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mv -f code/* . && rmdir code
mkdir -p .bin && echo "export PATH=$HOME/.bin:$PATH" >> .bash_profile

# Releases for Tekton CLI at: https://github.com/tektoncd/cli/releases
TKN_CLI_VERSION=0.4.0
TKN_CLI_VERSION=0.5.0
curl -kL https://github.com/tektoncd/cli/releases/download/v${TKN_CLI_VERSION}/tkn_${TKN_CLI_VERSION}_Linux_x86_64.tar.gz -o /tmp/tkn.tar.gz && \
tar -xvzf /tmp/tkn.tar.gz -C /tmp && \
chmod 755 /tmp/tkn && \
Expand Down
2 changes: 1 addition & 1 deletion workshop/content/exercises/post-pipelinerun.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ to see the output of this step.
You can also view more information about the pipeline run via `tkn` by running the
command below:

[source,bash,role=execute-1]
[source,bash,role=execute-2]
----
tkn pr describe $RUN
----
Expand Down
39 changes: 19 additions & 20 deletions workshop/content/exercises/trigger-pipeline.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,20 @@ After running the command above, the pipeline you created earlier is now running
and a number of pods are created to execute the tasks that are defined as part of the
pipeline. After 4-5 minutes, the pipeline run should finish successfully.

Additionally, you will begin to see the pipeline run logs immediately after the pod
for the first task is done initializing.

Before continuing, grab the name of the pipeline run and save it to an environment
variable so you can learn more about the pipeline run later in this workshop:

[source,bash,role=execute-2]
----
RUN=`tkn pr ls -o jsonpath='{$.items[?(@.status.conditions[0].reason=="Running")].metadata.name}' | tr ' ' '\n' | head -1`; echo $RUN
----

To view the pipeline run created, run the following `tkn` command:

[source,bash,role=execute-1]
[source,bash,role=execute-2]
----
tkn pr ls
----
Expand All @@ -78,7 +89,7 @@ a pod that will host steps that each run in a separate container. You can see
the pod for the first task on your pipeline (i.e. `build`) by running the following
command:

[source,bash,role=execute-1]
[source,bash,role=execute-2]
----
oc get pods
----
Expand All @@ -90,24 +101,6 @@ task of your pipeline.
Tekton CLI Logs
---------------

To view the logs for the pipeline run, you need the unique name assigned to it
when you ran `tkn pipeline start`. This is the same name as `tkn pr ls` outputs.

To grab the name of this into an environment variable, run:

[source,bash,role=execute-1]
----
RUN=`tkn pr ls -o jsonpath='{$.items[?(@.status.conditions[0].reason=="Running")].metadata.name}' | tr ' ' '\n' | head -1`; echo $RUN
----

Then run the following `tkn` command to access the logs of the pipeline run using the environment
variable to specify the name of the pipeline run:

[source,bash,role=execute-1]
----
tkn pr logs $RUN -f
----

The logs output tells you what tasks are running as well as what step it is running.
You'll see the output structured as `[task_name : step_name]`. An example from this
pipeline run is below for the `generate` step of the `build` task:
Expand Down Expand Up @@ -144,3 +137,9 @@ While the pipeline run is executing, you can take a look at how you can visualiz
a pipeline run through the OpenShift web console in the next section. Leave the logs
running so that you can confirm the successful deployment message when the pipeline run
finishes.

Clear the terminal without the running logs before continuing:
[source,bash,role=execute-2]
----
clear
----

0 comments on commit 10bf2f1

Please sign in to comment.