Details
Description
After a lot of debugging, it appears that Jenkins doesn't always publish the JENKINS_URL env var when pipeline docker agents are used. Ironically, HUDSON_URL appears to be consistently defined in both freestyle and pipelines. We need to add code to jenkins.sh to work around this Jenkins bug.