Reputation: 223
I am just wondering is it possible that I can tell whether I am in a Jenkins environment inside gradle? I just want to do something like
if (jenkins){
//do something
}else{
//do other
}
Upvotes: 10
Views: 1426
Reputation: 27485
You could check for existence of build-specific environment variables, like $BUILD_ID
or $BUILD_URL
, etc. They really shouldn't exist outside of Jenkins build, but if your environment is polluted, you could have them.
Upvotes: 4