Dashboard > CruiseControl > Home > TwoMinuteTutorial
TwoMinuteTutorial Log In | Sign Up   View a printable version of the current page.

Added by Michael Kloss , last edited by Michael Kloss on Sep 04, 2006  (view change)
Labels: 
(None)

Going a step further

Starting from the things we have done in the OneMinuteTutorial, we will go ahead by setting up a local cvs repository, importing the connectfour-example and make some changes to see where we end up and how Cruisecontrol really supports you. Ok, so let's start with the setup.

Setting up a cvs repository

To setup a local cvs-respository you just need to have a cvs-binary (cvs.exe, cvs) in place. First create your folder for your local-repository (for example mkdir /tmp/localrepo). After you have created this folder you have to create a repository here. This could be done by calling

cvs -d /tmp/localrepo init

If you take a look at this directory you should find a CVSROOT directory created there.

Importing the example

So, to go on and make our own Modifcations we need to import the connectfour example from the binary distribution and checkout one copy for our cruisecontrol-installation and one working copy that we can use to make changes and commit these changes to the local repository. To import the example go to our mycc environment (in these examples /opt/mycc) into the directory projects. There you will find the directory connectfour but containing CVS-informations. To delete this information you have to remove all CVS-directories under connectfour, so under UNIX this can be with

find . -name "CVS" | xargs rm -rf

Under windows you can open a search dialog in the connectfour-directory and search CVS then delete all found directories.

Done that we can import the connectfour example into our local repository. Use

cvs -d :local:/tmp/localrepo import -I ! -I CVS -W "*.jar -k 'b'" -m 'initial' connectfour CruiseControl EXAMPLE

to achieve this. After that look into your repository directory for a connectfour-directory. If it exists everything is fine and we can go on.

Check out versions

As mentioned before we have to checkout this project twice. First we will checkout the project for cruisecontrol. Go to your projects-directory (/opt/mycc/projects) and checkout the connectfour example. If you have still the previous connectfour-example here just delete the directory and checkout the version from the local-repository.

cvs -d :local:/tmp/localrepo checkout connectfour

Giving it a first try

Because the default config is configured to use a localworkingcopy for the connectfour-example we can just give it try and startup cruisecontrol. You should see no errors on start. Ok, point your browser to http://localhost:8080 and press the build-button. On the console you should see the checkout and build of the connectfour-example. So let's go on...

Making some modifications

Like in a real project you are not working on the copy for cruisecontrol. So we checkout another local-copy that we will change and check-in. (In this example we will use ~/scratchpad/connectfour). After the checkout go to the directory src/net/sourceforge/cruisecontrol/sampleproject in your working-copy and add some nonsens stuff in Cell.java. Then commit your change by

cvs commit

and waitfor cruisecontrol doing its next run. (If 5 minutes are too much time for you to wait, change in config.xml interval="300" to 30). You then should see the following screen in your browser

Fine, undo the change and commit again. Now you can start play around, try modifiying a test or the build-script.

In this command,

find . -name "CVS" | xargs rm -rf {} \;

the '{}' and '\;' serve no purpose, since you're using xargs. The other way is of course:

find . -name "CVS" -exec rm -rf {} \;

Which is where the '{}' and '\;' belong.

Powered by a free Atlassian Confluence Open Source Project / Non-profit License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators