0

I have a chained 2 builds scenario setup in VSTS.

I have a CI build, called 'Sync VSTS to GitHub' which runs two steps:

  1. A powershell command which pushes the changes from that commit to GitHub.

  2. Trigger another build, which compiles the solution, runs tests, deployments etc. (lets call it 'Proper Build')

This Sync VSTS to GitHub build has a trigger which detects when a push was made. That executes all OK.

The second build, the 'Proper Build' has no CI triggers defined. It is only supposed to be triggered manually (or rather by the 'Sync VSTS to GitHub' build).

What happens is that every time a push is made in Visual Studio, the 'Sync VSTS to GitHub' build is called. That succeeds, and then calls the Proper Build. And for some reason, this build is queued twice for the same changeset!
This second build is added after the first one runs for a short while:

enter image description here

Suddenly a wild build appears: enter image description here

The only difference that I see between the builds is the user on behalf of which the build is triggered:

First Build: enter image description here

Second Build: enter image description here

What is particularly weird is that this does not happen when the build is queued manually from VSTS (without a new changeset). In such scenario, each build is triggered once.

The build task that triggers the Proper Build is this one: https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks

This is how I configure it (I tried setting the highlighted option to different value, no effect). enter image description here

To confirm - when this task is disabled, then the 'Proper Build' is not triggered at all (as expected)

Any idea how to avoid this duplication?

4

1 回答 1

0

好吧,答案其实很简单:

  1. 摆脱“触发构建”任务
  2. 在“正确构建”上创建构建完成触发器,如下所示:

在此处输入图像描述

而已!

于 2018-04-26T13:50:17.017 回答