The document says "To prevent triggering two runs of B in this example, you must remove its CI trigger or pipeline trigger." However, if I remove pipeline trigger, then B won't be triggered at all. How can I trigger B only after A compiled?
โ Do not edit this section. It is required for docs.microsoft.com โ GitHub issue linking.
Actually, if I remove pipeline trigger, it uses implicit trigger so it's triggered once which is even worse.
@kenakamu Thank you for the question.
Assigning this to the author for further review to see if the documentation requires an update.
If this is product-related and is not yet currently feasible, please refer to Report a problem or Suggest a feature in the Azure DevOps community to solicit feedback from the product team.
Or, for additional support options, see:
@thomps23 Temporarily assigned.
@ashkir Doesn't appear as a valid alias.
@kenakamu Try trigger: none in your pipeline yaml
Thanks @billybraga. Is there anyway to trigger only previous pipeline completed?
@kenakamu Yes. Edit pipline > Menu > Triggers > Build completion > + Add > Choose build
@billybraga
is there a way to trigger a "Release" pipeline based on previous pipeline completed?
what is you said above is about tying about build pipelines together or sequencing them right?
In addition to what @mohammednaseem mentioned, is there any way to define the trigger in yaml rather than using GUI of ADO which may stay in projects?
Tried trigger:none in my CD Pipeline and import the CI Pipeline via resources, but CD Pipeline gets not triggered after CI Build was successfull
trigger: none works now for me
@the-mod Can you show us a sample of you yaml file? I've set up trigger: none and a CI Pipeline via resources, but it still don't work.
Hi @XREvo,
this is working for me.
Maybe you have an Issue with the Name of the referenced Pipeline.
It should be the same Name as the pipeline is stored at Azure.
My Build Pipeline appears under the name 'service-build'.
trigger: none
resources:
pipelines:
- pipeline: 'service-build-pipeline'
source: 'service-build'
trigger:
branches:
include:
- master
Thanks @the-mod for your response and for the sample.
Does the pipeline triggers only works on master ?
I'll explain myself :
ci.yml file on master (you'll find it at the end of my comment).ci on Azure DevOps.setup/cd from master. cd.yml file on setup/cd (you'll find it at the end of my comment).ci pipeline start automatically ๐.cd on Azure DevOps, from the cd.yml file.README.mdci pipeline start automatically ๐.ci pipeline nothing happens ๐.setup/cd into master.ci pipeline start automatically ๐.ci pipeline, cd pipeline start automatically ๐ค.That's why i'm asking if pipeline triggers only works on master ?
Here is my ci.yml file, register as ci pipeline into AzDO :
pool:
vmImage: 'ubuntu-latest'
trigger:
branches:
include:
- master
- setup/*
steps:
- task: CopyFiles@2
displayName: Copying
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: '**/*'
targetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: Publishing
inputs:
artifactName: 'app'
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
Here is my ci.yml file, register as ci pipeline into AzDO :
pool:
vmImage: 'ubuntu-latest'
trigger: none
resources:
pipelines:
- pipeline: ci
source: ci
trigger:
branches:
- master
- setup/*
steps:
- download: ci
artifact: app
@XREvo No it is not restricted only to master branch.
See Type of Triggers and here Trigger Schema.
In gernell, you can include and exclude branches, paths and tags for triggers.
The second pipeline you showed is your CD Pipeline, correct? (both are named CI)
Your CI Pipeline ran, cause you have a Trigger on branch setup/* which matches your Branch setup/cd where you pushed the CD Pipeline.
From what I now understood is, your CD Pipeline runs after CI Pipeline, which is fine now?
My bad! I do a copy/paste of the sentence, but dont correct it ๐
The second file is effectively cd (and not ci).
Yes, my CD pipeline runs after CI Pipeline. But it only works now that it's back on my master branch.
Before the PR it didn't work. In other words, a commit on setup/cd, triggered ci pipeline, but the cd pipeline wasn't triggered at the end of the ci pipeline (that's why i asked about the master branch, because it worked without touching anything after the PR).
@XREvo now I got your Point. For me it also only works on master, regardless what Branches I put for the tiggers ๐ค
I can also confirm that pipeline triggers works only on master branch. They are not triggered on other branches.
Confirm X 4, resource pipeline triggers only triggers in master.
(Using BitBucket repo)
Most helpful comment
I can also confirm that pipeline triggers works only on master branch. They are not triggered on other branches.