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

environmentVariables doesn't escape multiline content

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • job-dsl-plugin
    • None

      This keeps tripping me.

      This will result in invalid properties file format:

              environmentVariables {
                  env 'config', '''multiline
      content
      '''
      }
      

      You have to add sth like

      string.replaceAll('\n','\n\\' )

      to escape it manually

      EDIT: above should work but doesn't because of some bug in the envijector, but

      string.replace('\n','\\n')

      works

          [JENKINS-61346] environmentVariables doesn't escape multiline content

          Jakub Bochenski created issue -
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\\n' )}} to escape it manually
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          }
          '''
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\\n' )}} to escape it manually
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          }
          '''
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\\n' )}} to escape it manually
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\\n' )}} to escape it manually
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\\n' )}} to escape it manually
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\n' )}} to escape it manually
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\\\n' )}} to escape it manually
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          Jakub Bochenski made changes -
          Description Original: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {{string.replace('\n','\\n')}} works
          New: This keeps tripping me.

          This will result in invalid properties file format:
          {code} environmentVariables {
                      env 'config', '''multiline
          content
          '''
          }
          {code}

          You have to add sth like {{string.replaceAll('\n','\n\\' )}} to escape it manually

          EDIT: above should work but doesn't because of some bug in the envijector, but {code}string.replace('\n','\\n'){code} works

            jbochenski Jakub Bochenski
            jbochenski Jakub Bochenski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: