I should have said there is a “Escape quotes in parameter values” in the 
advanced section of the Trigger,

However this is only guaranteed to cause you pain.

That is you can disable it to fix your current issue – however if someone 
checks in code with commit message containing a quote (single double…)– it may 
well cause the build to fail again…

/James

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of James Nord (jnord)
Sent: 31 March 2014 14:23
To: jenkinsci-users@googlegroups.com
Subject: RE: Quoting of parameters: Gerrit Event Stream => Build Parameter => 
ANT Call

Hi Ralf/Dermagg?

There are unfortunately a few different issues all around quoting (that effect 
different platforms differently) and to my knowledge there is not a good cross 
platform way to escape quotes.

https://issues.jenkins-ci.org/browse/JENKINS-20808
https://issues.jenkins-ci.org/browse/JENKINS-16211
https://issues.jenkins-ci.org/browse/JENKINS-15074
https://issues.jenkins-ci.org/browse/JENKINS-11779
https://issues.jenkins-ci.org/browse/JENKINS-10984
https://issues.jenkins-ci.org/browse/JENKINS-10440

Depending on your needs – I may guess that a generic solution to 
https://issues.jenkins-ci.org/browse/JENKINS-10692 would provide you with a 
working option – but so far as I can tell attempts to fix the errors have just 
moved the error somewhere else.

The other issue with quoting is you may well be calling a batch file (in this 
case ant.bat) who may then blindly attempt to quote arguments in order to be 
safe – which then breaks as things are already correctly quoted ☹

/James



From: jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com> 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Dermagg B. Magnusson
Sent: 31 March 2014 14:14
To: jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>
Subject: Quoting of parameters: Gerrit Event Stream => Build Parameter => ANT 
Call

Hello,

hope someone can give some hints to the following problem:

I have Jenkins Gerrit Trigger Plugin setup to listen to the Gerrit Event Stream.

Jenkins: Jenkins ver. 1.509.4
Gerrit Trigger: 2.11.1
Running on Windows Server 2008 R2, 64 Bit


Some parameter include the mail address of the commiting user. This address, in 
the build parameters looks like this:

GERRIT_CHANGE_OWNER:   \"Lastname, Firstname\" 
<firstname.lastn...@somedomain.tld<mailto:firstname.lastn...@somedomain.tld>>

So when it comes to call ANT it look like this:


$ cmd.exe /C '""c:\Program Files\Apache\apache-ant-1.9.2\bin\ant.bat" ... 
"-DGERRIT_PATCHSET_UPLOADER=\""Lastname, Firstname\"" 
<firstname.lastn...@somedomain.tdl<mailto:firstname.lastn...@somedomain.tdl>>" 
... "'

Here the relevant part (extra "" have been added):

"
-DGERRIT_PATCHSET_UPLOADER=
\"
"
Lastname, Firstname
\"
"
<firstname.lastn...@somedomain.tdl<mailto:firstname.lastn...@somedomain.tdl>>
"
Outcome: quoting is broken, lastname (in bold letters) becomes the first 
non-paramter string in the ANT call and by this gets interpreted as build 
target.

So, would be great to get some answers/ideas!

Kind Regards,
Ralph
--
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<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
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<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to