I have a mono-repo with the below structure:
.
├── README.md
├── azure-pipelines.yml
├── common.py
├── sample-job1
|── azure-pipelines-sample-job1.yml
│ └── entry-point1.py
└── sample-job2
|── azure-pipelines-sample-job2.yml
└── entry-point2.py
The entry-point1.py and entry-point2.py have common functions written in common.py.
- If I make changes to common.py : azure-pipelines get triggered
- If I make changes to entry-point1.py : azure-pipelines-sample-job1 get triggered
- If I make changes to entry-point2.py : azure-pipelines-sample-job2 get triggered
What I would like to have in addtion is:
- if I make changes to common.py (only if this file is modified), I want the other 2 pipelines to be triggered azure-pipelines-sample-job1.yml, azure-pipelines-sample-job2.yml in addition to the existing logic to trigger azure-pipelines.yml
This is because entry-point1.py and entry-point2.py calls common.py so a rebuild of the code is necessary every time common.py is changed.
How do I add this trigger?
Below is the current triggers I have :
#azure-pipelines.yml
# Build numbering format
name: $(BuildID)
trigger:
branches:
include:
- test
- feat/*
paths:
exclude:
- 'sample-job1/*'
- 'sample-job2/*'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
echo "Hello from '/' root folder."
#azure-pipelines-sample-job1.yml
# Build numbering format
name: $(BuildID)
trigger:
branches:
include:
- test
- feat/*
paths:
include:
- 'sample-job1/*'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
echo "Hello from 'sample1'"
#azure-pipelines-sample-job2.yml
# Build numbering format
name: $(BuildID)
trigger:
branches:
include:
- test
- feat/*
paths:
include:
- 'sample-job2/*'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
echo "Hello from 'sample2'"