Search code examples
continuous-integrationdevopsazure-devops-server-2019

Trigger build pipeline (on the same branch) on completion of another pipeline


In our Azure DevOps Server 2019 we want to trigger a build pipeline on completion of another build pipeline. The triggered build should use the same source branch the triggering build used.

According to the documentation this does not work with classic builds or the classic trigger definition, but in the YAML definition for the triggered build:

build.yaml:

# define triggering build as resource
resources:
  pipelines:
    - pipeline: ResourceName
      source: TriggeringBuildPipelineName
      trigger:
        branches:
          - '*'

# another ci build trigger
trigger:
  branches:
    include:
      - '*'
  paths:
    include:
      - SubFoldder

pool:
  name: Default

When creating the pipeline like this, the trigger element under the pipeline resource gets underlined and the editor states that trigger is not expected inside a pipeline.

When saving the definition and trying to run it, it fails with this error:

/SubFolder/build.yaml (Line: 6, Col: 7): Unexpected value 'trigger'

(where "line 6" is the trigger line in the resources definition).

So my question is: How to correctly declare a trigger that starts a build pipeline on completion of another build pipeline, using the same source branch? Since the linked documentation actually explains this, the question rather is: what did I miss, why is trigger unexpected at this point?


Update: I just found this. So it seems one of the main features that they promised to have and documented as working, one of the main features we switched to DevOps for, is not even implemented, yet. :(


Solution

  • Updates are made every few weeks to the cloud-hosted version, Azure DevOps Services. These updates are then rolled up and made available through quarterly updates to the on-premises Azure DevOps Server and TFS.So, all features are release in Azure DevOps Service first.

    A timeline of feature released and those planned in the feature release can be found at here-- Azure DevOps Feature Timeline

    You could choose to directly use cloud version Azure DevOps Service instead or monitor latest update on above Feature Timeline with Azure DevOps Server. Sorry for any inconvenience.