Issue 0039

Summary
JENKINS_URL is wrong until after user configuration of Jenkins
Owner
Tim
Reporter
Tim
Status
closed
Priority
high

Description [edit section]

Lots of environment variables ending in _URL don't show up in the environment of jobs (or have invalid values) until after the user specifically saves the configuration of Jenkins.

Specifically, the following are not present in the environment of a job (or are wrong):

This can be fixed if someone goes to:

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.

Notes [edit section]

This was fixed in fuego and fuego core by the following commits:

backlink

Fuego Issues List