On Mon, Mar 9, 2015 at 9:23 AM, Rafael Ribeiro Rezende <rafaelrez...@gmail.com> wrote: > Is there any plugin to parse XML and extract selected fields into > Environment Variables? > > If not, would it make sense to implement something like this for the > community? > For instance, one would provide the XML file with the content: > > <project> > <developers> > <developer> > <id>dev1</id> > <name>Developer 1</name> > <email>develop...@email.com</email> > </developer> > <developer> > <id>dev2</id> > <name>Developer 2</name> > <email>develop...@email.com</email> > </developer> > </developers> > <organization> > <name>Company</name> > </organization> > </project> > > > Then, there would be an additional field where one could make the following > assignment: > DEV_USER = ${project.developers[1].id} > ORGANIZATION = ${project.organization.name} > > > The following environment variables would be created: > DEV_USER = dev1 > ORGANIZATION = Company >
Parsing xml always turns out to be non-trivial, so you'll probably want access to groovy's XmlParser or XmlSlurper functionality - which you could get from the groovy plugin. However, I think only the 'system' groovy step can add to the build job environment, and since it runs on the master I don't see how to make it read files in the slave's workspace. -- Les Mikesell lesmikes...@gmail.com -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAOAgVpwoty9EysqRK0dn%2B5OJd04a5APrTp8JCrrk13SWGQhFxA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.