Johan
Johan

Reputation: 40520

In which file on disk is "global environment variables" stored in Jenkins?

After an unsuccessful upgrade of Jenkins and its plugins, we're trying to get it back to its previous state. One of the things that have gone missing is the environment variables under "Global Properties" in "Global Configuration": enter image description here

I know that Jenkins stores its configuration on disk and we have a backup of most files, so my question is, where is the configuration file holding the environment variables located on the Jenkins server (running in Ubuntu)?

Upvotes: 0

Views: 561

Answers (1)

Ian W
Ian W

Reputation: 4767

It's going to be in your ${JENKINS_HOME}/config.xml

  <globalNodeProperties>
    <hudson.slaves.EnvironmentVariablesNodeProperty>
      <envVars serialization="custom">
        <unserializable-parents/>
        <tree-map>
          <default>
            <comparator class="hudson.util.CaseInsensitiveComparator"/>
          </default>
          <int>1</int>
          <string>key</string>
          <string>value</string>
        </tree-map>
      </envVars>
    </hudson.slaves.EnvironmentVariablesNodeProperty>

However, I think you should review Upgrading to Jenkins 2.277.1 Configuration Form Modernization and JENKINS-64072 - Configure UI completely broken after upgrade to 2.264. That's probably the likely culprit to your problem and steps to address.

Upvotes: 1

Related Questions