Triggering and running a pipeline
A PipelineRun starts a Pipeline and ties it to the Git and image resources that should be used for the specific invocation.
Procedure
-
Start the
Pipelineas follows:$ tkn pipeline start petclinic-deploy-pipeline \ -r app-git=petclinic-git \ -r app-image=petclinic-image \ -s pipeline Pipelinerun started: petclinic-deploy-pipeline-run-q62p8-
The
-rflag specifies thePipelineResources that should be provided to the pipeline -
The
-sflag specifies the service account to be used for running the pipelineNote: OpenShift Pipelines 0.7 does not automatically use the pipeline service account for running pipelineruns. This has been fixed in the OpenShift Pipelines 0.8 release. If you want to use the OpenShift Console developer perspective to start the pipeline with OpenShift Pipelines 0.7, run the following commands to elevate the permissions of the default service account used for running pipelineruns that are started by the OpenShift Console, as follows:
$ oc adm policy add-role-to-user edit -z default
Starting a pipeline instantiates the
PipelineRunand creates a number of pods to execute the tasks that are defined in the pipeline. ThePipelineRunautomatically creates and triggers theTaskRunsfor eachTaskin the pipeline.
-
-
After a few minutes, verify that the
Pipelineran successfully by listing all thePipelineRunsas follows:$ tkn pipeline list NAME AGE LAST RUN STARTED DURATION STATUS petclinic-deploy-pipeline 7 minutes ago petclinic-deploy-pipeline-run-tsv92 5 minutes ago 4 minutes Succeeded