[JENKINS-23007] Rework to not use previous build's environment.