After successful completion on the current build , another build is not getting triggered though I have added build under "build compilation" trigger

52 views Asked by At
  1. I have two pipeline (A and B)

  2. I scheduled a pipeline (A) 3 Under the pipeline (A) > Triggers > Build Completion > Added the "Pipeline B" (I have added the screenshoenter image description heret).

  3. FYI, I am triggering from AZURE Devops

  4. I have not added/Configured any time under "Scheduled" for pipeline "B"

  5. My "Pipeline A" runs successfully but trigger is not getting fired. So "Pipeline B" not running.

Can anyone let me know what could be the issue?

Thank you so much

Expected: "Pipeline B" should run on the completion of "Pipeline A"

2

There are 2 answers

1
mohamed saeed On

you can use the Azure DevOps pipelines and add each build in stage and use the dependencies between them like that :

trigger:
  branches:
    include:
      - main

stages:
  - stage: Build_A
    jobs:
      - job: Build_A_Job
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - script: echo "Building A"

  - stage: Build_B
    dependsOn: Build_A
    jobs:
      - job: Build_B_Job
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - script: echo "Building B"

  - stage: Deploy
    dependsOn: Build_B
    jobs:
      - job: Deploy_Job
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - script: echo "Deploying"
1
Ziyang Liu-MSFT On

If you want to trigger PipelineB after the completion of the PipelineA, you should set PipelineA as the trigger resource of PipelineB.

Build completion is used to specify which pipeline the current pipeline will be triggered by, rather than triggering the specified pipeline as a resource. See the detailed info from this official doc Trigger one pipeline after another (classic).

enter image description here