4.6. 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. It automatically creates and starts the TaskRuns for each Task in the Pipeline.
Procedure
Start the Pipeline for the back-end application:
$ tkn pipeline start build-and-deploy -w name=shared-workspace,claimName=source-pvc -p deployment-name=vote-api -p git-url=http://github.com/openshift-pipelines/vote-api.git -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-apiNote the PipelineRun ID returned in the command output.
Track the PipelineRun progress:
$ tkn pipelinerun logs <pipelinerun ID> -fStart the Pipeline for the front-end application:
$ tkn pipeline start build-and-deploy -w name=shared-workspace,claimName=source-pvc -p deployment-name=vote-api -p git-url=http://github.com/openshift-pipelines/vote-ui.git -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-uiNote the PipelineRun ID returned in the command output.
Track the PipelineRun progress:
$ tkn pipelinerun logs <pipelinerun ID> -fAfter a few minutes, use
tkn pipelinerun listcommand to verify that the Pipeline ran successfully by listing all the PipelineRuns:$ tkn pipelinerun listThe output lists the PipelineRuns:
NAME STARTED DURATION STATUS build-and-deploy-run-xy7rw 1 hour ago 2 minutes Succeeded build-and-deploy-run-z2rz8 1 hour ago 19 minutes SucceededGet the application route:
$ oc get route vote-ui --template='http://{{.spec.host}}'Note the output of the previous command. You can access the application using this route.
To rerun the last PipelineRun, using the PipelineResources and ServiceAccount of the previous Pipeline, run:
$ tkn pipeline start build-and-deploy --last