Pause queuing for All builds mechanism via application variable setup

Hi,

I have a tiny mechanism I implemented via an application level variable called %FreezeAllBuilds%
And I have the following 2 conditions on each of our project configurations: (ALL of the configurations)

  • ‘%FreezeAllBuilds%’ Does not equal ‘True’
    Or
  • ‘%AllowedToPublishDuringFreeze%’ Contains ‘$Build.StartedBy.EmailAddress$’

This is so I, the administrator can pause queuing of new builds in case I need to for some reason (we have such cases all the time)
It works perfect when I edit this variable manually, but I wanted a toggle button for it, so I created a tiny project and configuration that will do just that - toggle the application level variable from True to False and vice verse.
The is simple enough : if true set false, else set true.
But it isn’t toggling the value of the variable.
I understand now from the documentation that application variables are read-only at run time.
Can you suggest a way of some global tier variable that can be toggled in such a way to will give me this functionality? Or is the only way to pause / un-pause all builds on the server using my variable logic is to do it manually under Administration --> Variables each time?

Thanks!

Hi @ktopaz,

You can update application variables during a build using the Persist Build Variable build event handler.

Just ensure that the application variable is not overridden with a project or configuration variable as the value will get persisted to the most local variable.

1 Like