Stack Overflow Asked by oleksa on November 22, 2021
There is a build pipeline in the Azure git repository:
variables:
BuildConfiguration: release
BuildPlatform: 'any cpu'
trigger:
branches:
include:
- release/*
paths:
include:
- src/*
- azure-pipelines.yml
- versionFile
I’m pushing a local branch to the remote repository using the push
command like below:
git push --set-upstream origin release/0.6.9 Total 0 (delta 0), reused 0 (delta 0) To https://dev.azure.com/*****/**/_git/** * [new branch] release/0.6.9 -> release/0.6.9
and the new branch appears in the source control.
New branch changes contains files from the src
subfolder.
The problem is that build won’t start.
It should start as documented:
If your pipeline has path filters, it will be triggered only if the new branch has changes to files that match that path filter.
There is no space after release/*
filter as I’ve just checked.
What can I check additionally ?
UPD:
Should all path conditions to be true?
paths:
include:
- src/*
- azure-pipelines.yml
- versionFile
only src/*
files were changed with the new branch, the versionFile
and azure-pipelines.yml
are the same.
UPD2:
there is one more build pipeline to build the documentation
It starts on git push --set-upstream
trigger:
branches:
include:
- release/*
paths:
include:
- doc/*
I've disabled the existing pipeline and created a new one (from the same yml file).
The magic is that it started to work like a charm (I have not overridden the trigger using the pipeline UI)
The existing pipeline can't be deleted since there are releases based on the existing pipeline.
No it does not start to work like a charm. It has happened one time only.
the problem was in the path
condition - src/*
It is not recursive, so is checking for modified files in the the src/
folder only and no subfolders are checked.
However the - src
works fine for all files under src
folder, like below
paths:
include:
- src
Answered by oleksa on November 22, 2021
Test with the same triggers in Yaml file, it could trigger the build successfully.
I would like to share my steps and the possible cause of this issue.
Here are my steps, you could refer to them.
Repo structure:
Step1: Run Git command to push the changes to new branch.
Commands:
git clone "repourlxxx"
git checkout -b release/0.9.7
git add --all
git commit -m "first commit of my code"
git remote add origin xxx
git push --set-upstream origin release/0.9.7
Note: When you change the contents of the src folder locally, you need to use git commit
command to add the changes, and then push to the new branch. Otherwise, there will be no changes in the new branch, so no build is triggered.
Step2: the new branch release/0.9.7
will be created and the pipeline will be triggered.
Note: The YAML file (azure-pipelines.yml) with triggers needs to be included in the new branch
Workaround:
You could try to use the UI trigger to override the triggers in Yaml code.
Navigate to Settings-> Triggers -> Select Override the YAML continuous integration trigger from here
option.
Answered by Kevin Lu-MSFT on November 22, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP