Defining and creating pipeline resources

Pipeline resources are artifacts that are used as inputs to a task and can be output by a task.

Procedure

After you create tasks, create pipeline resources that contain the specifics of the Git repository and the image registry to be used in the pipeline during execution as follows:

  1. Create a PipelineResource that defines the Git repository for the front-end application:

     $ tkn resource create
     ? Enter a name for a pipeline resource : ui-repo
     ? Select a resource type to create : git
     ? Enter a value for url : http://github.com/openshift-pipelines/vote-ui.git
     ? Enter a value for revision :
     New git resource "ui-repo" has been created
  2. Create a PipelineResource that defines the OpenShift internal image registry to which you want to push the front-end image:

    $ tkn resource create
    ? Enter a name for a pipeline resource : ui-image
    ? Select a resource type to create : image
    ? Enter a value for url : image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/ui:latest
    ? Enter a value for revision :
    New git resource "ui-image" has been created
  3. Create a PipelineResource that defines the Git repository for the back-end application:

    $ tkn resource create
    ? Enter a name for a pipeline resource : api-repo
    ? Select a resource type to create : git
    ? Enter a value for url : http://github.com/openshift-pipelines/vote-api.git
    ? Enter a value for revision :
    New git resource "api-repo" has been created
  4. Create a PipelineResource that defines the OpenShift internal image registry to which you want to push the back-end image:

    $ tkn resource create
    ? Enter a name for a pipeline resource : api-image
    ? Select a resource type to create : image
    ? Enter a value for url : image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest
    ? Enter a value for revision :
    New git resource "api-image" has been created
  5. View the list of resources created:

    $ tkn resource ls
    
    NAME        TYPE    DETAILS
    api-repo    git     url: http://github.com/openshift-pipelines/vote-api.git
    ui-repo     git     url: http://github.com/openshift-pipelines/vote-ui.git
    api-image   image   url: image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest
    ui-image    image   url: image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/ui:latest