|
From: <ste...@Th...> - 2005-09-28 16:26:26
|
Owen (et al),
Here is the first draft of the UrlTrigger stuff talked about last week.
This is the original version that doesn't implement any of the
modificationDelay discussions that were talked about (this can be added
once we have things sorted).
The first 2 files are HttpWrapper.cs and HttpWrapperStatus.cs. These
belongs in project\core\util
The next file is the unit tests for the HttpWrapper. This belongs in
projects\core\UnitTests\Core\Util
The next file is the trigger itself, UrlTrigger.cs and this belongs in
project\core\Triggers
The final file is the trigger unit test file and this belongs in
project\core\UnitTests\Core\Triggers
What I'm really looking for at the moment is any comments on what I've
done. I need to do some testing with this version before we finally
commmit things.
Here is a bit of documentation I had previously on this. It will need
some work though ( I need to dig up the svn scripts we have as well ).
------------------------------------------------------------------------
---------------------------------------------------------
You need to edit you CVSROOT/loginfo file to get the post commit action
to work. On one of our projects we have the following:
----------------------------------------------------------
ALL /usr/bin/cvs-ccnet-notify allmodules
^MODULENAME\(/\|$\) /usr/bin/cvs-ccnet-notify MODULENAME
----------------------------------------------------------
Which basically means for any modules that change update run the
cvs-ccnet-notify script telling it to update the file allmodules. The
second line allows you to be a bit more granular by checking for
specific modules.
The final part is the cvs-ccnet-notify script which is:
---------------------------
#!/bin/sh
cat > /wwwroot/scm/$1
chmod a+rw /wwwroot/scm/$1
---------------------------
The path you need to set to be a folder somewhere on you webserver.
What should happen is that the filename passed as the parameter to the
script ends up containing the contents of the commit log message. You
will obviously need to sort out the proper permissions for the web
folder.
To use the trigger you need the following in your ccnet.config file:
<triggers>
<urlTrigger seconds=3D"60" buildCondition=3D"IfModificationExists"
url=3D"http://hostname/scm/modulename" />
</triggers>
And that should be it.
Things to remember / check:
1) You can manually check that the post commit scripts are running by
checking that the file is being updated on the webserver (one of the
advantages of pushing the log message into the file).
2) When CCNET starts up it should print the URL being used.=20
3) Everytime it checks the URL you should get a message saying that URL
Trigger is checking the following URL. If the URL changes it should
then move onto a checking modifications and query CVS.
4) On first startup it will always check CVS as it doesn't have any
history on the URL so treats it as a change.
------------------------------------------------------------------------
---------------------------------------------------------
Steve
|