Getting Started#830

Subscribe to Getting Started 3 post(s), 2 voice(s)

 
Avatar charlesjekal 2 post(s) #2212

I’ve been reading the guides and trying to understand how to set up Cruise, but I’ve encountered some problems. From my understanding, once I set up the pipeline with a SCM, Cruise will check-out the code. Once Cruise checks out the code, I’m trying to run a nant buildfile that compiles the checked-out code. Once the code is checked-out, I’m trying to run NUnit to run unit tests.

My questions are:
Will the source-code be checked out only when there is a modification? Or will forcing the build also check out the code?
Once the code is checked-out, how do I access it? Is it within the C:\Program Files\Cruise Agent\ directory? Are there any task variable I can use to access this path? Can I hard-code a path instead of the default location for checking-out?
After compiling is complete, I know I can save it in the Artifacts within Cruise. Is there a sample config or explanation on how to get this done?
After I save the binaries in Artifacts within Cruise, how does the next stage access the binaries?
As I mentioned earlier, I would like to run NUnit to run unit tests. Can this be accomplished with a nant buildfile? Would the job configuration be
<job name="RunUnitTests"> <tasks> <nant buildfile="nant-file-for-running-unit-tests" target="target-for-running-unit-tests" /> </tasks>
</job>

I’m sorry for asking such elementary questions and thank you for helping.

 
Avatar Chris Turner Moderator 10 post(s) #2213

Will the source-code be checked out only when there is a modification? Or will forcing the build also check out the code?

So there are two things here… Cruise Server and Cruise Agent. For SVN, the server will never check-out the code (for Mercurial it does).

The agent will always check-out the source into a sandbox (Cruise Agent\pipelines) and run your nant script from there. It doesn’t matter if this is caused by a modification or forcing the build. They work the same.

Once the code is checked-out, how do I access it?

The <tasks> tag within the <job> tag are used for accessing your code. The current working directory is the root of your checked-out code, so you shouldn’t need to know where it is from a running your tests standpoint.

Is it within the C:\Program Files\Cruise Agent\ directory?

It will be checked out to C:\Program Files\Cruise Agent\pipelines\{pipelineName}

Are there any task variable I can use to access this path?

No. We just set the current working directory of all of the tasks (including the exec task) to be the root of the checked-out code.

Can I hard-code a path instead of the default location for checking-out?

There is currently no way to change where the agent checks out the code. We are looking into allowing this to be an option, but it’s not there yet.

After compiling is complete, I know I can save it in the Artifacts within Cruise. Is there a sample config or explanation on how to get this done?

Here is the help page dealing with publishing artifacts.

After I save the binaries in Artifacts within Cruise, how does the next stage access the binaries?

The answer to this is a little more involved. Look at my response here.

As I mentioned earlier, I would like to run NUnit to run unit tests. Can this be accomplished with a nant buildfile? Would the job configuration be:

<job name="RunUnitTests">
    <tasks>
        <nant buildfile="nant-file-for-running-unit-tests" 
              target="target-for-running-unit-tests" />
    </tasks>
</job>

That looks right. The configuration reference for nant can be found here.

Hope this helps! If you have any other questions, just let us know.

Chris

 
Avatar charlesjekal 2 post(s) #2219

Chris, thanks so much for your help. I’ve been able to get Cruise mostly working now.

However, I am running into some problems running Cruise Agents from other machines. I have approved the agents from Cruise Server. nant will not execute anything; instead, I get a “BUILD FAILED” immediately. It appears that nant is throwing a “The directory name is invalid.” while starting up. However, if I manually run nant from the machine that Cruise Agent is running on, then everything appears fine (nant will correctly execute the tasks in the nant buildfile).

Also, if I install Cruise Agent on the same machine as Cruise Server, then everything runs correctly and I get no nant errors.

Any help with this is greatly appreciated. Thanks.