Retriggering build pipelines

Occasionally, your build pipeline may fail unexpectedly, necessitating a retrigger. For pull requests, this can be achieved by adding comments. For post-merge builds, retriggering can be done either through UI, or by using the API to add an annotation to your Component resource.

Retriggering a pre-merge build on a pull request

Prerequisite
  • You have a build pipeline run on a pull request that has failed, and you want to re-run the build without pushing a new commit.

Procedure
  1. Add a comment to the pull request with the text /retest to trigger a new build.

    The pipeline run should start executing in the Activity > Pipeline runs tab and in the pull request

    For additional options, refer to the pipelinesascode documentation.

Retriggering a post-merge build from from GitHub

Prerequisite
  • You have already merged a pull request, but the subsequent build failed, prompting a need for retriggering.

Procedure
  1. On the GitHub UI, navigate to the latest commit on your branch that that you want to rebuild.

  2. Comment /retest on the commit.

    The pipeline run should resume in the Activity > Pipeline runs tab.

    This procedure only works to retrigger the build pipeline for the latest commit on the branch.
    If you only want to retrigger the integration tests, see retriggering integration tests.

Retriggering a post-merge build from your main branch from the UI

Prerequisite
  • You have already merged a pull request, but the subsequent build failed, prompting a need for retriggering.

Procedure

In the console, complete the following steps to retrigger the build pipeline:

  1. Navigate to the Activity > Pipeline runs tab.

  2. Identify the pipeline run that you want to retrigger.

  3. Select the three dots on the right side of the table.

  4. Select the Rerun action.

    The pipeline run should resume in the Activity > Pipeline runs tab.

Retriggering a post-merge build from your main branch from the API

Prerequisite
  • You have already merged a pull request, but the subsequent build failed, prompting a need for retriggering.

  • You have CLI access to Konflux. For information on obtaining CLI access, refer to Getting started in CLI

Procedure
  1. Identify the Component whose pipeline requires rerun.

  2. Use the following command to annotate the Component, triggering a new build:

    $ kubectl annotate components/[component name] build.appstudio.openshift.io/request=trigger-pac-build
  3. The build is re-triggered automatically.

    $ tkn pipelinerun list
    
    [Example Output]
    NAME                            STARTED         DURATION   STATUS
    your-component-jfrdb            4 seconds ago   ---        Running