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

  1. Start the Pipeline as follows:

    $ tkn pipeline start build-and-deploy
    ? Choose the git resource to use for api-repo: api-repo (http://github.com/openshift-pipelines/vote-api.git)
    ? Choose the image resource to use for api-image: api-image (image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest)
    ? Choose the git resource to use for ui-repo: ui-repo (http://github.com/openshift-pipelines/vote-ui.git)
    ? Choose the image resource to use for ui-image: ui-image (image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/ui:latest)
    Pipelinerun started: build-and-deploy-run-z2rz8
    Showing logs...

    Starting a pipeline instantiates the PipelineRun and creates a number of pods to execute the tasks that are defined in the pipeline. The PipelineRun automatically creates and triggers the TaskRuns for each Task in the pipeline.

    Note the Pipelinerun ID returned in the command output above.

  2. Track the pipelinerun progress as follows:

    $ tkn pipelinerun logs <pipelinerun ID> -f -n pipelines-tutorial
  3. After a few minutes, verify that the Pipeline ran successfully by listing all the PipelineRuns as follows:

    $ tkn pipeline list
    
     tkn pipeline list
    
    NAME               AGE              LAST RUN                     STARTED         DURATION    STATUS
    build-and-deploy   11 minutes ago   build-and-deploy-run-z2rz8   5 minutes ago   5 minutes   Succeeded