1

I have established under what conditions Jenkins Groovy plugins will execute on either the master or the slave. Ultimately, I want to execute in the context of the current build on the slave. However, since you only have access to the API available in slave.jar, I am now stuck with how to set or change the result of the current build. Based on whether a built file is zero in size or not, should influence whether the build is marked as unstable. So, running on the slave, I have access to the file through:

new File("/path/to/built/file/on/the/slave")

I can check its size and decide whether the build should be marked as unstable. However, without the API access to hudson.model.Executor, how do you then accomplish this? The typical groovy manager API is not available through the plugin I am using either, so you must use native APIs.

Alternatively, is there a way to set the build to unstable instead of failed, from a shell script? It's a shame none of the shell script plugins provide an exit code evaluation property to allow you to control the build state based on this.

Any help appreciated.

Craig
  • 3,800
  • 4
  • 30
  • 47
  • You probably have already but if not have alook at this question here : http://stackoverflow.com/questions/11160363/execute-shell-script-after-post-build-in-jenkins – AltF4_ Nov 04 '14 at 21:49

0 Answers0