31

I'm trying to set up a non-default URL as part of a puppet script that installs Jenkins. I know how to edit the value via the web UI but I can't seem to find where the value is actually stored. I've looked through the jenkins_home folder and apache and have yet to find it.

nweiler
  • 1,140
  • 1
  • 13
  • 23

6 Answers6

30

It stores it in a rather unlikely place: hudson.tasks.Mailer.xml in Jenkins home folder.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • 52
    In case someone runs into this nowadays, it's `jenkins.model.JenkinsLocationConfiguration.xml` in recent versions – joostdevries Apr 10 '14 at 13:17
  • 1
    do you guys know if changing the URL in that file should actually change the URL for Jenkins? Or must it be changed from the management console? – Kappacake Sep 05 '18 at 10:46
18

I'm on Jenkins 2.68 and it's stored at jenkins.model.JenkinsLocationConfiguration.xml under the Jenkins home folder.

wonton
  • 7,568
  • 9
  • 56
  • 93
  • 2
    do you know if changing the URL in that file should actually change the URL for Jenkins? Or must it be changed from the management console? – Kappacake Sep 05 '18 at 10:46
11

If you don't find the URL when grepping Jenkins home, it's because you didn't saved the configuration. If not set, Jenkins fallback to request URL, without saving it on disk.

root@jenkins-dev:/var/lib/jenkins# grep jenkinsUrl *.xml
jenkins.model.JenkinsLocationConfiguration.xml:  <jenkinsUrl>http://jenkins-dev.lxc/</jenkinsUrl>
root@jenkins-dev:/var/lib/jenkins# 
Étienne Bersac
  • 580
  • 6
  • 11
0

The url can be found in the UI/web app under configuration > Jenkins Location; alternatively, login to your server and cat the contents at this location: var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml

-3

The file config.xml in the Jenkins home folder.

sti
  • 11,047
  • 1
  • 27
  • 27
-3

I did a grep for "http" in my Jenkins root directory led me to hudson.model.UpdateCenter.xml

I'm using Jenkins version 1.462

pwan
  • 2,894
  • 2
  • 24
  • 38