Azure Devops Running Two Builds Sequentially

后端 未结 2 1988
旧巷少年郎
旧巷少年郎 2021-01-23 08:05

We have Azure Devops setup. Right now our Project will Build Twice.

Once during Pull Request Checkin in the YAML file, and another due to Build Settings (picture below).<

2条回答
  •  长情又很酷
    2021-01-23 08:28

    Functionally the two build may not always be the same.

    Lets say you have the below example. Capital letters are commits and lower-case letters are potential commits.

      e e'
     /   \
    |  |   D
    C  |   B 
     \ |  /
       A
    

    This shows, two branches coming off of the A commit (master branch). Each feature branch had a PR created for each one. One branch has a build on the e commit and the other branch had a build on the e' commit. Azure devops cannot be sure which PR will be merged first.

    Once you merge both of the PR's you will end up with a new commit in master that has not been previously built. This is described here

       F
       E \
     / |   D
    C  |   B 
     \ |  /
       A
    

    If you want to eliminate the need for your build on master, you can set the build expiration to Immediately when branch name is updated

提交回复
热议问题