Reputation: 10619
Is there any jenkins property which can i access in my java code to identify that code is running on jenkins ? I have around 1000 of test cases running on different jenkins CI, which is managed by different teams. I dont want to set any manual flag or string properties in each of my jenkins build, There should be some property which can be use to identify this ?
Upvotes: 1
Views: 485
Reputation: 14746
You can take a look at this page which calls out all the environment variables that are exposed by Jenkins. So you could have your Java code query any of these environment variables to determine if the java is being run in a Jenkins environment or is it being run from a dev box or an IDE even.
Upvotes: 2