[英]Azure devops: Monorepo trigger
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. entry-point1.py 和 entry-point2.py 有共同的函数写在 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.这是因为 entry-point1.py 和 entry-point2.py 调用了 common.py,所以每次 common.py 更改时都需要重新构建代码。
How do I add this trigger?如何添加此触发器?
Below is the current triggers I have:以下是我目前拥有的触发器:
#azure-pipelines.yml #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 #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 #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:如果要在修改文件“ common.py ”时触发azure-pipelines-sample-job1.yml和azure-pipelines-sample-job2.yml ,只需将其路径添加到触发路径:
azure-pipelines-sample-job1.yml天蓝色管道样本-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天蓝色管道样本-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'"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.