We have a similar requirement in our build.gradle file and we check for the
BUILD_NUMBER environment variable to tell if its coming from Jenkins. Its
true that, in theory, it *could* be set, but I guess it comes down to how
much you really don't want a false positive :)

Richard.


On Wed, Jun 18, 2014 at 8:59 PM, William Damage <[email protected]>
wrote:

> Our devs use the same build.gradle script in Android Studio as Jenkins -
> but we'd like to know if the build was created locally or from CI.
> I guess I can test if $JENKINS_HOME is set as an env var but this doesn't
> seem too robust; an enterprising dev might even set Jenkins up locally or
> whatever.
>
> Is there anything I can test to guarantee the build is being run under
> Jenkins please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to