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.
What I would like to have in addtion is:
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'"
If you want to trigger azure-pipelines-sample-job1.yml and azure-pipelines-sample-job2.yml when file “ common.py ” is modified, just add its path to the trigger paths:
azure-pipelines-sample-job1.yml
# Build numbering format
name: $(BuildID)
trigger:
branches:
include:
- test
- feat/*
paths:
include:
- 'sample-job1/*'
- 'common.py'
pool:
vmImage: 'windows-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/*'
- 'common.py'
pool:
vmImage: 'windows-latest'
steps:
- script: |
echo "Hello from 'sample2'"
See: Paths for details.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.