Limit build to run only in specific time domain in TeamCity

926 Views Asked by At

I have a build with a finish build trigger and i want to limit it to run only in specific time domain (e.g. between 4 AM to 5 AM) regardless to the finish build trigger, any suggestions?

3

There are 3 best solutions below

1
On

You could remove the finish build trigger and add an extra step to the triggering build which calls the rest api.

By adding a bit of logic around the call the check the time is in the required range, you should be able to achieve what you are after.

1
On

You can use cron-like expressions to write schedule triggers that will trigger your build at customized times. You can read the teamcity specs here

For example , if you want to run a target everyday at 4.30 AM , you would have to define it in the following syntax.

Seconds         0
Minutes         30
Hours           4
Day-of-month    *
Month           *
Day-of-week     ?
4
On

Another solution is to pause build configuration. You can pause build configuration using REST API.