2

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?

MTZ4
  • 2,274
  • 2
  • 25
  • 41

3 Answers3

1

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

Alina Mishina
  • 3,320
  • 2
  • 22
  • 31
  • So i need to implement a scheduled code that will pause and start the build each day? – MTZ4 Jul 05 '15 at 05:29
  • Yes, if you want to trigger builds only in special time window - when build configuration is active. Also here is the related request in TeamCity tracker: https://youtrack.jetbrains.com/issue/TW-17581, please vote for it. – Alina Mishina Jul 06 '15 at 18:56
  • Also since **TeamCity 9.1** Scheduled build trigger can behave as Finished build trigger. It has got an ability to watch for builds in other build configurations and trigger a build if these builds change. More on this [here](https://confluence.jetbrains.com/display/TW/Hajipur+9.1+EAP1+%28build+35957%29+Release+Notes#Hajipur9.1EAP1%28build35957%29ReleaseNotes-Scheduletriggerimprovements). – Alina Mishina Jul 06 '15 at 19:01
  • It's not the solution i was expecting but it's the best (until now...). Thanks! – MTZ4 Jul 07 '15 at 05:11
0

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.

infojolt
  • 5,244
  • 3
  • 40
  • 82
  • Indeed that will do the job, thanks. I hoped for a build in teamcity solution for it... – MTZ4 Jun 23 '15 at 08:46
0

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     ?
Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
  • 1
    Maybe i didn't understood your solution, but i don't need a schedule.. i need to limit the other trigger to a certain time domain. – MTZ4 Jun 23 '15 at 08:44