Reputation: 11
I'm trying to develop a pipeline from feature-branch. sample-code:
trigger:
branches:
include:
- deploy-pipeline/sql/test/*
exclude:
- deploy-pipeline/pipeline/*
- deploy-pipeline/sql/sample_scripts/*
Here deploy-pipeline is the name of the feature branch. I have azure-pipeline.yml file in the feature branch. I want to deploy only sql scripts inside deploy-pipeline/sql/test/ so i have included it in the include flag, whenever there's any change in sql/test folder the pipeline should trigger automatically and deploy sql scripts to my test environment. Once I tested this functionality working as expected then I can push this pipeline structure to master to deploy sql scripts only in specific folder. I tested pushing changes to the sql/test folder, sample sql scripts. But the pipeline isn't triggering automatically. Not sure where I'm missing it. Please help me.
Upvotes: 1
Views: 2319
Reputation: 5242
In trigger branches, what you need to write is the name of your branch. If your branch name is deploy-pipeline/sql/test
, you don't need to write /*
behind it to indicate every files in the branch.
In the other words, you just need to write the branch name in trigger, then every thing in the branch can trigger the pipeline.
So the script should be like this:
trigger:
branches:
include:
- deploy-pipeline/sql/test
exclude:
- deploy-pipeline/pipeline
- deploy-pipeline/sql/sample_scripts
I guess you might be confusing path triggers with branch triggers. Only branch names can be written in the branch trigger and only path can be written in the path trigger.
Click CI triggers for detailed information and examples.
Upvotes: 1