This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.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-api
$ 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-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note the PipelineRun ID returned in the command output.
Track the PipelineRun progress:
tkn pipelinerun logs <pipelinerun ID> -f
$ tkn pipelinerun logs <pipelinerun ID> -f
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start 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-ui
$ 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-ui
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note the PipelineRun ID returned in the command output.
Track the PipelineRun progress:
tkn pipelinerun logs <pipelinerun ID> -f
$ tkn pipelinerun logs <pipelinerun ID> -f
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After a few minutes, use
tkn pipelinerun list
command to verify that the Pipeline ran successfully by listing all the PipelineRuns:tkn pipelinerun list
$ tkn pipelinerun list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The 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 Succeeded
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 Succeeded
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the application route:
oc get route vote-ui --template='http://{{.spec.host}}'
$ oc get route vote-ui --template='http://{{.spec.host}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
$ tkn pipeline start build-and-deploy --last
Copy to Clipboard Copied! Toggle word wrap Toggle overflow