I have this block in the Cruisecontrol.net xml file:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project name="MyProject">
<artifactDirectory>C:\Program Files (x86)\CruiseControl.NET\Mydashboard</artifactDirectory>
<sourcecontrol type="p4">
<view>//Myprojectfolder/Code/...</view>
<executable>c:\Program Files\Perforce\p4.exe</executable>
<client>Myworkspace</client>
<user>John</user>
<applyLabel>false</applyLabel>
<port>PERFORCEPR123:10080</port>
<autoGetSource>true</autoGetSource>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework64\v3.5\MSBuild.exe</executable>
<workingDirectory>D:\Workspace\Myworkspace\Code\src</workingDirectory>
<projectFile>Myproject.sln</projectFile>
<targets>Build</targets>
<timeout>1000000</timeout>
<logger>C:\Program Files (x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
<buildArgs>/v:minimal /noconlog /p:Configuration=Release</buildArgs>
</msbuild>
</tasks>
<publishers>
<xmllogger logDir="C:\Program Files (x86)\CruiseControl.NET\Mydashboard\Buildlogs" />
<buildpublisher>
<sourceDir>D:\Workspace\Myworkspace\Code\src\newsrc\Webapplication.site</sourceDir>
<publishDir>D:\deployment\Webapplication.site</publishDir>
<useLabelSubDirectory>false</useLabelSubDirectory>
<alwaysPublish>false</alwaysPublish>
</buildpublisher>
</publishers>
</project>
</cruisecontrol>
But,when i build my project i am getting the below error:
BUILD EXCEPTION
Error Message:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Perforce GetModifications failed: c:\Program Files\Perforce\p4.exe -s -c Myworkspace -p PERFORCEPR123:10080 -u John -P john123 changes -s submitted //Myprojectfolder/Code/......#2014/01/15:08:13:20,#2014/01/15:08:14:20
Error output from process was:
error: Perforce password (P4PASSWD) invalid or unset.
exit: 1
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Perforce.P4.Execute(ProcessInfo process, String description)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Perforce.P4.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModificationsWithLogging(ISourceControl sc, IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
Is there a workaround for this?
Thanks
I suspect CC is just using the Perforce command line client. To workaround this I would:
1) Add a group to Perforce and set the Timeout to unlimited.
2) Add the user running the CC task to the Perforce group
3) From the build machine run 'p4 -u login'
This will store a local ticket that lasts forever to authenticate the user. If you need a an account to run tools like CC under, fill out this form and Perforce will give you a free background user:
http://www.perforce.com/support-services/request-background-user
If you have a bad ticket file, you will get this error. Delete the ticket file, then run your tool or run p4 login to recreate the ticket.
*nix location: ~/.p4tickets
Windows location: C:\Documents and Settings\\p4tickets.txt
Bug Reference
p4 login reference
Below worked for me.
Set env variable P4PASSWD
Open new cmd prompt,
p4 login
Related
I am trying to configure Cruisecontrol.net for UCM Clearcase for the first time. Following is the sourceControl tag in the ccnet.config file:
<sourcecontrol type="clearCase">
<branch>123_India_Release</branch>
<autoGetSource>true</autoGetSource>
<viewName>admin_123_CRUISE</viewName>
<viewPath>$(ViewDirectory)</viewPath>
<useLabel>false</useLabel>
<useBaseline>false</useBaseline>
<executable>cleartool.exe</executable>
</sourcecontrol>
I constantly receive the following error:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control
operation failed: cleartool: Error: Not an object in a vob: "PATH TO
THE VIEW"
When I run cleartool from an arbitrary directory with the following parameters:
cleartool.exe lshist -r -nco -branch "123_India_Release" -since
05-Dec-2012.14:38:18 -fmt
I get the same error. But if I change the working directory to $(ViewDirectory) before running cleartool, it runs fine.
How should I make Cruisecontrol.net run cleartool.exe from the $(ViewDirectory)?
I have already tried adding <workingDirectory>$(ViewDirectory)</workingDirectory> tag before <executable>cleartool.exe</executable> but it did not work.
Any help would be appreciated.
EDIT 1:
As a workaround I have done the following:
<exec>
<executable>cleartool.exe</executable>
<baseDirectory>d:\Workspace\123_India_Release\VOB</baseDirectory>
<buildArgs>update -force</buildArgs>
<buildTimeoutSeconds>6000</buildTimeoutSeconds>
</exec>
I have added this to the tasks tag. I have configured an hourly trigger which does the following:
1) Update snapshot view
2) Build the VS 2010 solutions mentioned in the tasks tag.
The limitations are:
1) The trigger is hourly. I want it to be a commit based trigger.
2) This is a workaround
EDIT 2:
Further experimentation revealed that the ccnet.exe works fine. It does all that is needed. The issue is caused by the service ccservice.
I have stopped ccservice for now and started ccnet.exe. I plan to leave it running.
The View directory isn't enough: you must specify a vob.
See for instance:
"clearfsimport: Error: Not an object in a vob: "\"." (as an illustratio of that error message)
this thread (or this one): "You have to specify explicitly the VOB(s) to check for modification set"
The path should looks like:
<viewPath>Drive:\path\to\view\vobname</viewPath>
If your $(ViewDirectory) already references Drive:\path\to\view, then you could use:
<viewPath>$(ViewDirectory)\vobname</viewPath>
I am trying to copy a folder to a remote machine using xcopy. This command is executed via cruise control task. I can run xcopy source destOnRemoteMachine successfully if i am running it from command prompt. But if i am executing it from cruise control .net, it is always complaining about "Invalid drive specification" error.
I tried :
> <exec
> executable="c:\Windows\System32\xcopy.exe">
> <baseDirectory>$(BASE)\Project</baseDirectory>
> <buildArgs>.\*.* RemoteMachine\Project /Y</buildArgs>
> <buildTimeoutSeconds>10</buildTimeoutSeconds>
> <successExitCodes>-1,0,1</successExitCodes>
> </exec>
and :
<exec executable="c:\Windows\System32\cmd.exe">
<baseDirectory>$(BASE)\Project</baseDirectory>
<buildArgs>/C xcopy $(BASE)\Project\*.* RemoteMachine /y</buildArgs>
<buildTimeoutSeconds>30</buildTimeoutSeconds>
<successExitCodes>-1,0,1</successExitCodes>
</exec>
Any Suggestions?
thanks for your answer. Putting xcopy in batch was also not helpful, the problem was something else. here is problem:
It was problem with the account on which Cruise Control .net service was running. It was running as local service. Thus was not able to see the network path. I changed CCNet Service to run on a domain account which have permission to read/ write on remote machine. This solved my problem.
Thanks.
Create a batch file using xcopy source destOnRemoteMachine command and execute that bat file using <exec> command in cruise control .net
In my case I was running CC as a user account, after having used NET USE to persistently map a drive letter to a network share on another domain. Although it worked in a desktop session, CC could still not get to the share as part of the build. Executing NET USE as part of the build (without a drive mapping) allowed the copy to succeed.
<exec program="net" verbose="true">
<arg value="use" />
<arg value="\\server\share" />
<arg value="password" />
<arg value="/user:domain\username" />
</exec>
I have an xml file that I ma tryin to read from
string xmlTemplatePath = Path.Combine(Environment.GetEnvironmentVariable("RoleRoot") + #"\", #"approot\myxml.xml");
Using XDocument doc = XDocument.Load(xmlTemplatePath), however I get an access denied exception both on the cloud and development environment. Any ideas why a read is denied?
I know, old thread... but the answer could be useful to someone nevertheless.
It appears that an azure worker process runs under a custom user (shows up as a GUID in taskmgr). This user account appears to be quite restricted and has no read-access to the filesystem (even inside the approot directory).
My solution was to create a startup script for the azure role (see msdn article) which uses icacls to add permissions to access the files. In this case, I created a file called startup\Install.cmd in my project, containing the following:
#echo off
if "%EMULATED%"=="true" goto :EOF
echo Allowing access to files
cd directory_where_files_exist
icacls *.* /grant Everyone:F
In my ServiceDefinition.csdef file, I instruct the Azure deployment system to run this startup script during deployment by putting this inside the role definition (e.g. <WorkerRole>):
<Startup>
<Task executionContext="elevated" commandLine="startup\Install.cmd">
<Environment>
<Variable name="EMULATED">
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/#emulated" />
</Variable>
</Environment>
</Task>
</Startup>
The variable "EMULATED" is set when the emulator is running - note that in the startup/Install.cmd file above, I skip doing the permission change if running in the emulator.
Looks fine to me. I even grabbed your code and dropped it into a worker role, calling it from OnStart(), after creating myxml.xml in my project root, just to make sure I wasn't missing something obvious.
Check myxml.xml properties: "Build Action" should be "Content" and "Copy to Output Directory" should be "Copy always" or "Copy if newer". If that doesn't fix it, check permissions on that file.
hi all,
can any one tell how to commit into
tortoisesvn using cruise control
config file. I am getting an error
"C:*****\Documentation\trunk\dotnet\svn"
is not executable or it may not exist.
here's the config part...
<workingDirectory>C:\*****\Documentation\trunk\dotnet\</workingDirectory>
<category>Individual Solutions</category>
<modificationDelaySeconds>10</modificationDelaySeconds>
<sourcecontrol type="svn">
<trunkUrl>******* svn url *********</trunkUrl>
<username> unname </username>
<password> pwd </password>
<autoGetSource>true</autoGetSource>
</sourcecontrol>
<tasks>
<exec>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
<successExitCodes>0</successExitCodes>
</exec>
<exec>
<executable>iisreset</executable>
<buildArgs>/stop</buildArgs>
</exec>
<exec>
<executable>c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe /command:commit /path:"C:\*****\Documentation\trunk\dotnet\"</executable>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
<successExitCodes>0</successExitCodes>
<description>checkin shared content...</description>
</exec>
<exec>
<executable>iisreset</executable>
<buildArgs>/start</buildArgs>
</exec>
</tasks>
</project>
Thank you all,
There's a few things:
You want to pass the command-line arguments to in the <buildArgs> element, not as part of the <executable> element (like you've done for the "issreset" command, for example).
Why are you checking stuff in after every build? The way you seem to have things set up here, it's just going to go into an infinite loop, building then checking in and building again (because it detected a new check-in). Generally, you don't check build outputs into your repository.
Currently I have this sourcecontrol config block.
<sourcecontrol type="svn">
<trunkUrl>https://SampleSVNOnlineRepository.com/12maksdde12d123ede12</trunkUrl>
<workingDirectory>c:\MyProject</workingDirectory>
<username>admin</username>
<password>mypassword</password>
</sourcecontrol>
Cruise Control Exception:
Source control failure : Unable to execute file [c:\MyProject\svn]. The file may not exist or may not be executable.]
What seems to be the problem here?
It means that CruiseControl.NET cannot find the svn executable. You'll have to specify it with the executable element, e.g:
<sourcecontrol type="svn">
...
<executable >absolute\path\tp\subversion\executable</element>
Did you checkout the project first by hand in that location? As I understood when I played with phpUnderControl, which uses CruiseControl, you do the first checkout by hand.