Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Run script after server restart? #4501

Laba42 ·

Is there a way to run a groovy script or QuickBuild configuration automatically after a server restart?

  • solved #2
  • replies 1
  • views 944
  • stars 0
robinshen ADMIN ·

You may schedule a configuration to run periodically with below script:

groovy:
import com.pmease.quickbuild.bootstrap.Bootstrap;

def serverToken = vars.get("serverToken");
if (serverToken.value != Bootstrap.serverToken) {
 logger.info("do something once after reboot");
 serverToken.setValue(Bootstrap.serverToken);
}

Here variable serverToken should be defined in this configuration with an initial empty value. This works as Bootstrap.serverToken will be changed every time after server reboots