Reputation: 61
How can i access jenkins build status at runtime without email-ext
plugin?
i want to access build_status using environment variable of jenkins. Or Any other way to access build status variable of jenkins?
Upvotes: 3
Views: 9393
Reputation: 503
You can use currentBuild.currentResult
which is a global variable inside jenkins server to access the current build status. These variables are accessible inside pipelines.
Further you can check all the available global variables inside the server using below url
http://<server>/pipeline-syntax/globals
Upvotes: 1
Reputation: 4667
The default Jenkins environment variables don't include the build result.
However, you can use the Groovy Postbuild Plugin, which is run under the Jenkins JVM and have access to the current instance of the build.
Then from groovy you can access the build result via manager.build.result
. See my answer here for the example usage.
Upvotes: 2