Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CruiseControl - PHP lint check works via ANT but not through CruiseControl

So I am writing an ant buildfile which will be used within cruisecontrol and ran into a weird issue. I've Googled the problem but haven't come across any concrete solutions, so I figured I would post the question here.

I have the following ant task:

<target name="module.lint">
    <apply executable="/usr/bin/php" failonerror="true">
        <arg value="-l" />
        <fileset dir="/path/to/my/elite/code" includes="**/*.php" />
    </apply>
</target>

And when I run it using:

ant -buildfile /path/to/my/elite/buildfiles/project/elite/build.xml module.lint

It runs fine, but when I attempt to build the project through CruiseControl GUI, I get the following errors:

[cc]Aug-09 15:51:04 ScriptRunner  - fileset: Setup scanner in dir /path/to/my/elite/code with patternSet{ includes: [**/*.php] excludes: [] }
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] Executing '/usr/bin/php' with arguments:
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] '-l'
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] '/path/to/my/elite/code/Script.php'
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply]
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] The ' characters around the executable and arguments are
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] not part of the command.
[cc]Aug-09 15:51:04 ScriptRunner  - Execute:Java13CommandLauncher: Executing '/usr/bin/php' with arguments:
[cc]Aug-09 15:51:04 ScriptRunner  - '-l'
[cc]Aug-09 15:51:04 ScriptRunner  - '/path/to/my/elite/code/Script.php'
[cc]Aug-09 15:51:04 ScriptRunner  -
[cc]Aug-09 15:51:04 ScriptRunner  - The ' characters around the executable and arguments are
[cc]Aug-09 15:51:04 ScriptRunner  - not part of the command.
[cc]Aug-09 15:51:04 ScriptRunner  -     [apply] No syntax errors detected in /path/to/my/elite/code/Script.php

Not sure why I am getting the "characters ... not part of the command" errors, although it does look like the lint check did actually execute.

What do I need to do to fix the "characters ... not part of the command" errors?

like image 255
Mike Purcell Avatar asked Aug 09 '12 23:08

Mike Purcell


1 Answers

Those messages indicate Ant is running in verbose or debug mode when the build is run from CruiseControl. (Try running from the command line with the -v option to see for yourself.)

Check your CC config for the build - see whether usedebug or similar is being set. Alternatively, some sort of custom logging may be used that logs at debug level.

like image 197
martin clayton Avatar answered Oct 17 '22 03:10

martin clayton