0

I would like to disable/enable Build Controller (or Build Agents) from a bat file. I want to do this so we can schedule builds every night, but then disable them during code-freeze. "TFPT builddefinition /enabled:false" is close... but that is only for cloning build defs. If not, is there a way to disable checkins from a bat file? Then I would edit my Build Def and uncheck the box for "Build even if nothing has changed since the previous build". Thanks

RGuggisberg
  • 4,630
  • 2
  • 18
  • 27

1 Answers1

1

You can create a Rest call to the private and undocumented TFS API, but you should know what you are doing.

Or you can use a scheduled tasks to control your agent service installation on your build server.

But there are better ways to control your sources and releases.

It seems like the problem is your TFS project setup. For example, use "GIT Hub Flow" with “Pull Requests” and no one can change the master without a approved PR.

The developers can he developers can work and you don’t need plan a “Code Freezes" or "removing permissions" or stuff like this.

I also wouldn´t stop the deployments for the dev and test systems.

If you want to avoid that anybody creates a release to a special set of environment (Stag and Prod) set an approvers to control the release process.

The understanding Git-Hub-Flow site

"GitHub Flow is a lightweight, branch-based workflow that supports teams and projects where deployments are made regularly." GIT Hub

https://guides.github.com/introduction/flow/

k7s5a
  • 1,287
  • 10
  • 18