continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r724273 - in /continuum/branches/continuum-distributed-builds: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/
Date Mon, 08 Dec 2008 07:43:38 GMT
Author: ctan
Date: Sun Dec  7 23:43:37 2008
New Revision: 724273

URL: http://svn.apache.org/viewvc?rev=724273&view=rev
Log:
-added logs
-added throws exception

Modified:
    continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java

Modified: continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=724273&r1=724272&r2=724273&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
Sun Dec  7 23:43:37 2008
@@ -16,5 +16,6 @@
 
     List<BuildAgentListener> getBuildAgentListeners();
 
-    void reload();
+    void reload()
+        throws ContinuumException;
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=724273&r1=724272&r2=724273&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Sun Dec  7 23:43:37 2008
@@ -75,6 +75,7 @@
     private List<BuildAgentListener> listeners;
 
     public void initialize()
+        throws ContinuumException
     {
         List<BuildAgentConfiguration> agents = configurationService.getBuildAgents();
 
@@ -103,9 +104,12 @@
                 {
                     BuildAgentListener listener = new DefaultBuildAgentListener( agent.getUrl(),
false, agent.isEnabled() );
                     listeners.add( listener );
+                    log.info( "add listener for build agent '" + agent.getUrl() + "'" );
                 }
             }
         }
+
+        buildProjectsInQueue();
     }
 
     public ConfigurationService getConfigurationService()
@@ -167,12 +171,15 @@
     public void buildProjectsInQueue()
         throws ContinuumException
     {
-        for ( PrepareBuildProjectsTask task : projectsBuildInQueue )
+        if ( projectsBuildInQueue != null )
         {
-            Map projectsAndBuildDefinitions = task.getProjectsBuildDefinitionsMap();
-            int trigger = task.getTrigger();
-            
-            buildProjects( projectsAndBuildDefinitions, trigger, true );
+            for ( PrepareBuildProjectsTask task : projectsBuildInQueue )
+            {
+                Map projectsAndBuildDefinitions = task.getProjectsBuildDefinitionsMap();
+                int trigger = task.getTrigger();
+                
+                buildProjects( projectsAndBuildDefinitions, trigger, true );
+            }
         }
     }
 
@@ -185,6 +192,7 @@
         {
             if ( !listener.isBusy() && listener.isEnabled() )
             {
+                log.info( "initializing buildContext" );
                 List buildContext = initializeBuildContext( projectsAndBuildDefinitionsMap,
trigger, listener );
 /*
                 try
@@ -229,6 +237,7 @@
                 projectsBuildInQueue = new ArrayList<PrepareBuildProjectsTask>();
             }
 
+            log.info( "no build agent available, put in queue" );
             PrepareBuildProjectsTask prepareBuildTask = new PrepareBuildProjectsTask( projectsAndBuildDefinitionsMap,
trigger );
             projectsBuildInQueue.add( prepareBuildTask );
         }
@@ -240,7 +249,8 @@
         try
         {
             int projectId = getProjectId( context );
-            
+        
+            log.info( "update scm result of project" + projectId );
             Project project = projectDao.getProjectWithScmDetails( projectId );
             
             ScmResult scmResult = new ScmResult();
@@ -287,6 +297,7 @@
 
             if ( error != null )
             {
+                log.info( "scm error, not building" );
                 updateBuildAgent( project.getId(), true );
             }
         }
@@ -304,6 +315,8 @@
             int projectId = getProjectId( context );
             int buildDefinitionId = getBuildDefinitionId( context );
 
+            log.info( "update build result of project '" + projectId + "'" );
+
             Project project = projectDao.getProjectWithAllDetails( projectId );
             BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId
);
 
@@ -355,6 +368,7 @@
     }
 
     public void reload()
+        throws ContinuumException
     {
         this.initialize();
     }
@@ -556,6 +570,8 @@
                 {
                     if ( removeAll )
                     {
+                        log.info( "available build agent '" + listener.getUrl() + "'" );
+
                         listener.setProjects( null );
                         listener.setBusy( false );
 
@@ -567,6 +583,8 @@
 
                         if ( !listener.hasProjects() )
                         {
+                            log.info( "available build agent '" + listener.getUrl() + "'"
);
+                            
                             listener.setBusy( false );
 
                             buildProjectsInQueue();



Mime
View raw message