JENKINS-24554

Builds get triggered multiple times when the SCM URL contains variables that change on each node ie system variables.

When building environment variables and/or comparing revision across builds, make sure to use the system environment variables from the build you are comparing to otherwise the comparison is unfair