- JENKINS_URL is wrong until after user configuration of Jenkins
Specifically, the following are not present in the environment of a job (or are wrong):
- JOB_URL - doesn't show up
- BUILD_URL - doesn't show up
- HUDSON_URL - doesn't show up
- JENKINS_URL - doesn't show up
- JOB_DISPLAY_URL - has invalid URL
- RUN_CHANGES_DISPLAY_URL - has invalid URL
- RUN_DISPLAY_URL - has invalid URL
This can be fixed if someone goes to:
- Manage Jenkins ->
- Configure System -> (notes or sets the value in "Jenkins URL"), then clicks "Save".
This creates the file /var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml with the following contents:
Until this file exists, nothing can use the URLs. Indeed, JOB_DISPLAY_URL is present in the job environment, but it has a value like the following:
Jenkins developers do not consider this a bug. See this issue report: https://issues.jenkins-ci.org/browse/JENKINS-28466
Because of this, the function abort_job in engine/scripts/common.sh uses a hardcoded URL instead of JENKINS_URL. This should be changed. There should be a way to configure the server with the correct URL on startup.
This has the side effect of making Fuego code dependent on a static port number, which means that you can't easily change the port number of Jenkins in case it conflicts with another program (using port 8080 - like another instance of Jenkins). Changing the Jenkins port will cause abort_job to fail.