|
| 1 | += Retriggering build pipelines |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +See also xref:/how-tos/testing/integration/rerunning.adoc[Retriggering integration tests]. |
| 6 | + |
| 7 | +== Retriggering a Pre-merge build on a pull request |
| 8 | + |
| 9 | +.**Prerequisite** |
| 10 | + |
| 11 | +- 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. |
| 12 | + |
| 13 | +.**Procedure** |
| 14 | + |
| 15 | +. Add a comment to the pull request with the text `/retest` to trigger a new build. |
| 16 | + |
| 17 | +You should see the pipelinerun start executing in the UI and in the pull request. |
| 18 | + |
| 19 | +NOTE: For additional options, refer to the link:https://pipelinesascode.com/docs/guide/running/#gitops-command-on-pull-or-merge-request[pipelinesascode documentation]. |
| 20 | + |
| 21 | +== Retriggering a Post-merge build from your main branch from the UI |
| 22 | + |
| 23 | +.**Prerequisite** |
| 24 | + |
| 25 | +- You have already merged a pull request, but the subsequent build failed, prompting a need for retriggering. |
| 26 | + |
| 27 | +.**Procedure** |
| 28 | + |
| 29 | +In the console, complete the following steps to retrigger the build pipeline: |
| 30 | + |
| 31 | +. Navigate to the *Activity* > *Pipeline runs* tab. |
| 32 | +. Identify the pipeline run that you want to retrigger. |
| 33 | +. Select the three dots on the right side of the table. |
| 34 | +. Select the *Rerun* action. |
| 35 | + |
| 36 | +The pipeline run should resume in the *Activity* > *Pipeline runs* tab. |
| 37 | + |
| 38 | +== Retriggering a Post-merge build from your main branch from the API |
| 39 | + |
| 40 | +.**Prerequisite** |
| 41 | + |
| 42 | +- You have already merged a pull request, but the subsequent build failed, prompting a need for retriggering. |
| 43 | +- You have CLI access to {ProductName}. For information on obtaining CLI access, refer to xref:/getting-started/cli.adoc[Getting started in CLI] |
| 44 | + |
| 45 | +.**Procedure** |
| 46 | + |
| 47 | +. Identify the *Component* whose pipeline requires rerun. |
| 48 | +. Use the following command to annotate the *Component*, triggering a new build: |
| 49 | ++ |
| 50 | +[source] |
| 51 | +---- |
| 52 | +$ kubectl annotate components/[component name] build.appstudio.openshift.io/request=trigger-pac-build |
| 53 | +---- |
| 54 | + |
| 55 | +. The build is re-triggered automatically. |
| 56 | + |
| 57 | ++ |
| 58 | +[source] |
| 59 | +---- |
| 60 | +$ tkn pipelinerun list |
| 61 | +
|
| 62 | +[Example Output] |
| 63 | +NAME STARTED DURATION STATUS |
| 64 | +your-component-jfrdb 4 seconds ago --- Running |
| 65 | +---- |
0 commit comments