3

I'm try to develop a cruise control step which will process database migration scripts and apply them.

I'd like to be able to get hold of a list of the modifications from the SourceControl (to see if any new database changes need to be applied).

Any ideas how I can achieve this? I know that this information is written into the log xml but I was wondering if there is an easy mechanism to get a reference to this from with an Ant builder.

I have investigated writing a custom CC Listener or Builder plugin but neither supply this in the interface.

wheel.r
  • 211
  • 1
  • 4

2 Answers2

2

We have "svn update" as one of the steps in ant builder, and later we use output redirected to the file (ant property also could be used):

<exec executable="svn" dir=".">
   <arg line="up"/>
   <redirector output="svnup.log" alwayslog="true" append="true"/>
</exec>
<property name="svnup.log" value="svnup.log"/> 

this creates file named "svnup.log" in the build folder with output of "svn up" command.

vpolozov
  • 334
  • 1
  • 10
  • I wanted to tap into and utilize the results from the modificationset part of the cruise control build. Your solution involves making an additional svn call, which would work also. – wheel.r Dec 02 '11 at 11:13
0

I think I'm going to try to write a custom plugin implementing Publisher

@Override
public void publish(Element cruisecontrolLog) throws CruiseControlException {     XMLLogHelper xmlHelper = new XMLLogHelper(cruisecontrolLog);
  Set<Modification> modifications = xmlHelper.getModifications();
  for (Modification modification : modifications) {
    handleModification(modification);           
  }
}

Or another idea is to use the timestamp flag in the sscm ant task combined with the cclastbuildtimestamp property supplied to the ant builder to produce a list of files changed since last build.

wheel.r
  • 211
  • 1
  • 4