Nagarajan S
Nagarajan S

Reputation: 103

Cannot run program "p4": CreateProcess error=2, The system cannot find the file specified

I'm developing automate deployment script for Coldfusion project.

Tool: cruisecontrol.net, ant script Source control: perforce

Executing the following ant script from cruisecontrol.net i'm getting this error: "Cannot run program "p4": CreateProcess error=2, The system cannot find the file specified"

But its working fine from command line:

ant -f deployment.xml

deployment.xml file content:

<!-- Get Latest revision from perforce -->
<echo message="Perforce code base Get Latest revision Started"/>
<p4sync port="${p4.server}"
client="${p4.workspace}"
globalopts="${p4.password}"
user="${p4.username}"
view="${p4.branch}"/>
<echo message="Perforce code base Get Latest revision completed"/>

ccnet.config:

<project name="TestMGDeployment">
   <triggers>
      <intervalTrigger seconds="300" />
   </triggers>
   <tasks>
      <exec executable="C:\Apache\apache-ant-1.8.1\bin\ant.bat">
         <baseDirectory>C:\cruisecontrol\Projects</baseDirectory>
         <buildArgs>-f deployment.xml</buildArgs>
      </exec>
   </tasks>
</project>

Thanks, Nagarajan

Upvotes: 4

Views: 6660

Answers (2)

Saket
Saket

Reputation: 46127

Check if you have setup the P4PORT environment variable. That should be set to: [your perforce server]:[perforce port].

For e.g., P4PORT=perforce.xyz.com:1666

Upvotes: 2

skolima
skolima

Reputation: 32674

Your CruiseControl.net is probably running under different user account, make sure you have p4 in system PATH or specify the full path to the executable in your p4sync task.

Try running in command line instead of as a service to negate user environment definitions issue.

Upvotes: 2

Related Questions