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

Rundeck plugin requires newlines that can't be saved to XML

      The Rundeck plugin requires that option name/values be separated "one per line".

      This works fine via the UI, but can't be supported when using the underlying config.xml with the createItem web API since XML does not allow encoding of newlines in contact data.

      Here's a sample config.xml:

      [anthony@ip-10-176-57-29 Example1Code]$ more config.xml
      <?xml version='1.0' encoding='UTF-8'?>
      <project>
      <actions/>
      <description>Build the Duke's Bank application</description>
      <keepDependencies>false</keepDependencies>
      <properties/>
      <scm class="hudson.scm.SubversionSCM">
      <locations>
      <hudson.scm.SubversionSCM_-ModuleLocation>
      <remote>http://sources.dukesbank.dtolabs.com/repos/dukesbank/trunk/src</remote>
      <local>.</local>
      </hudson.scm.SubversionSCM_-ModuleLocation>
      </locations>
      <excludedRegions></excludedRegions>
      <includedRegions></includedRegions>
      <excludedUsers></excludedUsers>
      <excludedRevprop></excludedRevprop>
      <excludedCommitMessages></excludedCommitMessages>
      <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/>
      </scm>
      <canRoam>true</canRoam>
      <disabled>false</disabled>
      <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
      <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
      <triggers class="vector">
      <hudson.triggers.SCMTrigger>
      <spec>5 * * * *</spec>
      </hudson.triggers.SCMTrigger>
      </triggers>
      <concurrentBuild>false</concurrentBuild>
      <builders>
      <hudson.tasks.Ant>
      <targets>-Djboss.home=/opt/jboss-4.0.3SP1 compile package-ejb package-web package-client assemble-app</targets>
      <antName>Ant 1.8.2</antName>
      <buildFile>j2eetutorial14/examples/bank/jboss-build.xml</buildFile>
      </hudson.tasks.Ant>
      </builders>
      <publishers>
      <hudson.tasks.ArtifactArchiver>
      <artifacts>j2eetutorial14/examples/bank/jar/JBossDukesBank.ear</artifacts>
      <latestOnly>false</latestOnly>
      </hudson.tasks.ArtifactArchiver>
      <org.jenkinsci.plugins.rundeck.RundeckNotifier>
      <jobId>4e5b4574-8014-4369-b7e1-c3e3c8b87ad1</jobId>
      <options>configuration_version=http://build.dukesbank.dtolabs.com:8080/job/IntegrationJBoss/lastSuccessfulBuild/artifact/JBossDukesBank.tgz
      dukesbank_version=http://build.dukesbank.dtolabs.com:8080/job/Example1Code/lastSuccessfulBuild/artifact/j2eetutorial14/examples/bank/jar/JBossDukesB
      ank.ear</options>
      <nodeFilters></nodeFilters>
      <tag></tag>
      <shouldWaitForRundeckJob>true</shouldWaitForRundeckJob>
      <shouldFailTheBuild>true</shouldFailTheBuild>
      </org.jenkinsci.plugins.rundeck.RundeckNotifier>
      </publishers>
      <buildWrappers/>
      </project>

      ... and here's the command used to load it to Jenkins:

      [jboss@domU-12-31-39-07-34-61 dukesbank]$ curl -S -H "Content-Type: text/xml" -s --data "@examples/example1/jenkins/Example1Conf/config.xml" "http://build.dukesbank.dtolabs.com:8080/createItem?name=Example1Conf"

          [JENKINS-11103] Rundeck plugin requires newlines that can't be saved to XML

          Anthony Shortland created issue -
          Vincent Behar made changes -
          Assignee New: Vincent Behar [ vbehar ]
          Vincent Behar made changes -
          Component/s New: rundeck [ 15941 ]

          XML does allow newlines.

          Try saving data once from UI and open the XML file in text editor.

          Kohsuke Kawaguchi added a comment - XML does allow newlines. Try saving data once from UI and open the XML file in text editor.
          Kohsuke Kawaguchi made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Vincent Behar added a comment -

          Anthony, the problem is that you used the --data option instead of --data-binary (which preserves new-lines).
          I tried with "curl ... --data-binary ..." and it worked fined.

          Vincent Behar added a comment - Anthony, the problem is that you used the --data option instead of --data-binary (which preserves new-lines). I tried with "curl ... --data-binary ..." and it worked fined.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 141322 ] New: JNJira + In-Review [ 189556 ]

            vbehar Vincent Behar
            ashortland Anthony Shortland
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: