slolife
slolife

Reputation: 19870

Team Foundation Server Schedule trigger only if another build is not failing

Currently I have a canary build that builds code and runs tests, but doesn't "publish" anything. It is just a way to make sure that a checkin doesn't break the build.

I have a second build that is the "Publish" build that builds and publishes (at this point it does not do tests because it assumes that the canary build validated tests). This publish build runs every night IF there are changesets in the queue. But I'd like to prevent the publish build from running if the last canary build broke as well. How can I do that?

Publish build:

  1. Schedule build at 1am and run:

    a. IF there are changesets in the queue AND

    b. IF the last Canary build succeeded.

Upvotes: 1

Views: 1367

Answers (3)

Isaiah4110
Isaiah4110

Reputation: 10080

Is your build process too time consuming? If not why not do a build right before publishing? There by you dont have to check the CI build output?

It's easy and you dont need any extra effort :)

Upvotes: 0

suresh2
suresh2

Reputation: 1169

There's no way to check another build fails or not in the default process template unless you create a custom template like this one http://blog.stangroome.com/2011/09/06/queue-another-team-build-when-one-team-build-succeeds/

Why don't you include the unit tests in the publish build, what ever the size of the change set I guess the unit test is going to run once and i guess it's not going to take more time. So you can change the flow

Publish build:

Schedule build at 1am and run:

a. IF there are changesets in the queue AND

b. IF the build succeeds and unit test passes.

Upvotes: 0

Paul Michaels
Paul Michaels

Reputation: 16685

Have you thought about changing your 'canary' build to a gated check-in, which will prevent any code from getting into the code base unless the build succeeds.

Then, set your nightly build as a schedule (which I imagine you already have), but just uncheck "Build even if nothing has changed"

Upvotes: 3

Related Questions