Determine if jenkins environment is inside gradle

I'm just wondering if it is possible that I can tell if I am in a Jenkins environment inside gradle? I just want to do something like

if (jenkins){ //do something }else{ //do other } 
+7
jenkins build.gradle jenkins-plugins gradle
source share
1 answer

You can check for environment variables to build, such as $BUILD_ID or $BUILD_URL , etc. They really shouldn't exist outside of the Jenkins build, but if your environment is dirty, you can have them.

+2
source share

All Articles