Build chains and scheduled trigger

Here is our scenario, which I would expect to be very typical - three build configurations: Build, Test, Deploy. Only Build produces artifacts. Test obviously depends on Build. Deploy depends on both Build and Test.

Now we don't want to deploy every successful build. Instead we have scheduled trigger to start Deploy at particular time of the day. Deploy supposed to pick up binaries (atrifacts) from the latest available successful Build which also passed Test step.  

What we get now - when scheduled trigger fires off the whole chain starts from the beginning: Build -> Test -> Deploy. This is not what we need, as Build + Test may take hours. We want to deploy at configured time using the latest available successfully tested binaries. How do we make that happen? Looks so simple, yet I cannot figure it out on my own. Please help!

Konstantin

2 comments
Comment actions Permalink

Hello Konstantin,

What TeamCity version do you use? How did you configure Schedule trigger?
Since TeamCity 9.1 Schedule trigger has the ability to "Promote build if there is a dependency (snapshot or artifact) on its build configuration"
You can create a Schedule trigger on Deploy build configuration, that will watch for last successful build in Build build configuration and enable "Promote build if there is a dependency..." option.

0
Comment actions Permalink

-- You can create a Schedule trigger on Deploy build configuration, that will watch for last successful build in Build build configuration and enable "Promote build if there is a dependency..." option.

I'm trying to do exactly that. So there is Schedule Trigger on Deploy configuration.
Checkbox "Trigger only if watched build changes" checked, although I'm not sure what it exactly does.
Second dropdown listbox shows "Last Successful Build"
Checkbox "Promote build if there is a dependency (snapshot or artifact) on its build configuration" is checked tol.

The big question now is what to select in the first dropdown listbox?

You said - select Build configuration there. But there may be succesful builds which are not yet passed through Test or even worse - failed Test configuration. How do we make sure that Deployment would not pick up one of those builds?
We can watch for Test build, but the artifact we need to get from the corresponding Build!

So our logic here depends on two input factors - 1. Find the latest build passed Test and note build number; 2. Get artifacts for that build number from Build.

So far I don't see how build promotion feature helps here.

Konstantin

0

Please sign in to leave a comment.