I already discovered how to do this via the REST api, however I'd like to do this for example from a groovy script, but couldn't find documentation on it.
- solved #2
- replies 4
- views 765
- stars 1
I already discovered how to do this via the REST api, however I'd like to do this for example from a groovy script, but couldn't find documentation on it.
This can be done via below script:
groovy:
import com.pmease.quickbuild.entitymanager.SettingManager;
import com.pmease.quickbuild.setting.system.PauseSystem;
def systemSetting = SettingManager.instance.getSystemSettingDef();
def pauseSystem = new PauseSystem();
//pauseSystem.setUser("qbMaintenance");
pauseSystem.setReason("System Maintenance is running. Please wait until maintenance process is complete.");
systemSetting.setPauseSystem(pauseSystem);
SettingManager.instance.saveSystemSetting(systemSetting);
Thank you, that's a big help. I do have one followup-question though: I want to restart the QB-Server after setting "Pause System", and when the reboot process is finished reset the flag so builds can run again.
So far I'm doing this via a scheduled script on the server itself using the REST api. Is there a workaround to run a script while "Pause System" is enabled?
Unfortunately this is not possible as by definition the system is paused, and no any builds will be able to run.
Hi, to be able to start and stop the system we wrote some scripts that pause the system via the REST API, then restart the server.
Finally when the server is up, our script unpause the system.
It's working well, but a native feature to do all that could be useful.