How to automatically change the trigger type of a build definition periodically?

290 Views Asked by At

I'm using TFS 2013 and VS 2013.

I created a build definition for one of our company projects and it is working fine under the following build trigger types. (To see the Type of build triggers, right click the build definition ->Edit Build Definition -> On the dialog Box/Wizard that shows up, click the 'Trigger' Tab.)

  • Manual
  • Schedule

[IMG]http://i59.tinypic.com/2ch03so.png[/IMG]

Currently what we are doing is, during the working hours, we set the Trigger Type to MANUAL. And then when we leave the office (after working hours) we set the Trigger Type to SCHEDULE and leave. We are doing this manually(changing the radio buttons in the above diagram).

Is there a way to automate this scenario? (for example, from 8.30 AM - 5.30 PM the Trigger Type should be MANUAL and after 5.30 PM, the Trigger Type should be automatically changed to SCHEDULE)

1

There are 1 best solutions below

0
On BEST ANSWER

I can't understand why you'd want to do that. If you want the build to run every night at a certain time, just set it to Scheduled and leave it that way. You can still run it manually during the day if you desire without needing to change the trigger type.

Update: But if you really wanted to do it you could shedule a PowerShell that changes it.