Shiva
Shiva

Reputation: 81

change the build status to NOT_BUILT if a file exists in post build

I create a file in workspace for a specific type of branch during my compilation. If the file exists I want the change the built status to NOT_BUILT and skip the job.

How can I do it through post build groovy script.

Upvotes: 0

Views: 2968

Answers (1)

daspilker
daspilker

Reputation: 8194

The Groovy Postbuild plugin exposes a variable called manager which can be used to access Jenkins objects. See the plugin's wiki page for details.

To set the build result to NOT_BUILT, do this:

manager.build.result = hudson.model.Result.NOT_BUILT

Upvotes: 3

Related Questions