Forum Discussion
jerinjames
Mar 23, 2021Copper Contributor
yaml pipline
I am creating a yaml pipeline , and my data is present in different azure git repos. I want my pipeline to trigger when any change in data happens in the master branch of any repos. I looked through the documentation, and did as told , but the trigger is not working. Please find the error in my yml pipeline.
- FromelardSteel ContributorAt the start of your YAML file you can put that keys:
trigger:
- master
- develop
- release*
(adapting with your case), it will start immediately when a change is commit into any of those branches
You have also this following part to schedule your pipeline:
schedules:
- cron: "0 4 * * *"
displayName: Each Day 4AM
branches:
include:
- develop
So take a look in YAML options:
- https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#ci-triggers
- https://docs.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers?view=azure-devops&tabs=yaml
Fab- jerinjamesCopper Contributor
Fromelard thanks for the suggestion, but i tried and still it is not getting triggered. Is there anything else that i should keep in mind while trying it .
- jerinjamesCopper ContributorThanks for the update, but still i am still not able to get the triggers , for the branch changes. My requirement is actually , if there is any changes in any of the defined branchs of the repos, my pipeline needs to be triggered
- cpatemanCopper ContributorHello,
normally you would only have one repo linked to a pipeline, so it might be fiddly to get this to work.
I think you can do it by referencing each repo using the Resources feature:
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops&tabs=schema
This can also have triggers in these elements, so they can trigger the pipelines.
You can then acces the repo code by choosing it in the download.
The trick will be using the if statements maybe to choose which one to using.