Reputation: 3588
I need to trigger multiple pipelines from another pipeline. For this i got ADO resources in YAML to configure. A resource is anything used by a pipeline that lives outside the pipeline.
Steps i followed:
The yaml there is :
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- none
resources:
pipelines:
- pipeline: 02-understanding-stages-pipeline
project: azure-devops-kubernetes-terraform
branch: master
source: 02-understanding-stages-pipeline
trigger:
branches:
- master
stages:
- Build
- DevDeploy
Error in YAML
An error occurred while loading the YAML build pipeline. The array must contain at l
least one element. Parameter name: stages
02-understanding-stages-pipeline is another pipeline in another project. I need to trigger and set of other such pipelines from this pipeline.
Question :
Thanks in advance!!
Upvotes: 0
Views: 1248
Reputation: 40849
Suggestions as how to trigger pipelines from other pipelines
You can use Trigger Build Task extension as following:
- task: TriggerBuild@3
displayName: 'Trigger a new build of Validate-BuildVariable Update'
inputs:
buildDefinition: 'Your build name'
useSameBranch: false
branchToUse: master
waitForQueuedBuildsToFinish: true
authenticationMethod: 'OAuth Token'
password: $(System.AccessToken)
Or Rest API
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1
Any idea how to resolve the error i get
I made a test and this works for me:
trigger: none
resources:
pipelines:
- pipeline: pipelineUnderstanding
branch: master
source: kmadof.dm-so-47-multi-stage
trigger:
branches:
- master
stages:
- Build
- Deploy
steps:
- script: echo 'siema'
I would suggest you to check your stages if your pipelie has exactly as you wrote here.
What are source and pipeline under pipelines? Can explain briefly?
Source is
name of the pipeline that produces an artifact
Pipeline is
identifier for the resource used in pipeline resource variables
It is just an alias of resource object. Please check it here
Upvotes: 1