Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56516

Variable substitution issue when using configuration as code to create managed config files

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
      Jenkins 2.150.3
      Config file provider 3.5
      Configuration as code 1.7
    • Similar Issues:

      Description

      I'm using the config file provider for Maven settings.  The resulting settings file should have a placeholder that will be replaced by Maven.  However, the Maven format this ( ${env.HOME}) causes it to get replaced by some interaction between this plugin and the configuration as code.

      If the CASC source file has 

      <username>${env.USERNAME}</username>

      The config file provider has that line as

      <username></username>

      This is the content of the file when viewed in Manage Jenkins > Managed files > [configuration file].  So this must be happening during the process of applying a new configuration.   I've confirmed that the text is missing in the plugin's config file (org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml).

      This appears to be a change of behavior with the new version of the configuration file provider plugin.  It was working for me with a previous (probably 2.18) version.

        Attachments

          Activity

          Hide
          troy_jacobson Troy Jacobson added a comment -

          Closing.  I finally found the way (prefix the sequence with a ^) to prevent the substitution.

          Show
          troy_jacobson Troy Jacobson added a comment - Closing.  I finally found the way (prefix the sequence with a ^) to prevent the substitution.

            People

            • Assignee:
              domi Dominik Bartholdi
              Reporter:
              troy_jacobson Troy Jacobson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: