continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1160979 - in /continuum/trunk: continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/ continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/exe...
Date Wed, 24 Aug 2011 05:24:21 GMT
Author: ctan
Date: Wed Aug 24 05:24:20 2011
New Revision: 1160979

URL: http://svn.apache.org/viewvc?rev=1160979&view=rev
Log:
[CONTINUUM-2657] make build agent environments overwrite Master's environments

Modified:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java?rev=1160979&r1=1160978&r2=1160979&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentReleaseManager.java
Wed Aug 24 05:24:20 2011
@@ -27,6 +27,7 @@ import java.util.Properties;
 
 import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
 import org.apache.continuum.buildagent.installation.BuildAgentInstallationService;
+import org.apache.continuum.buildagent.model.Installation;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
@@ -81,6 +82,23 @@ public class DefaultBuildAgentReleaseMan
         String executable = buildAgentInstallationService.getExecutorConfigurator(
             BuildAgentInstallationService.MAVEN2_TYPE ).getExecutable();
 
+        if ( environments == null )
+        {
+            environments = new HashMap<String, String>();
+        }
+
+        // get environments from Slave (Build Agent)
+        List<Installation> installations = buildAgentConfigurationService.getAvailableInstallations();
+
+        if ( installations != null )
+        {
+            for ( Installation installation : installations )
+            {
+                // combine environments (Master and Slave); Slave's environments overwrite
Master's environments
+                environments.put( installation.getVarName(), installation.getVarValue() );
+            }
+        }
+
         if ( environments != null )
         {
             String m2Home =

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=1160979&r1=1160978&r2=1160979&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
Wed Aug 24 05:24:20 2011
@@ -404,11 +404,16 @@ public class BuildProjectTaskExecutor
             // get environments from Master (Continuum)
             Map<String, String> environments = buildAgentManager.getEnvironments( buildDefinitionId,
installationType );
 
-            // get environments from Slave (Build Agent)
-            for ( Installation installation : buildAgentConfigurationService.getAvailableInstallations()
)
+            List<Installation> installations = buildAgentConfigurationService.getAvailableInstallations();
+
+            if ( installations != null )
             {
-                // combine environments (Master and Slave); Slave's environments overwrite
Master's environments
-                environments.put( installation.getVarName(), installation.getVarValue() );
+                // get environments from Slave (Build Agent)
+                for ( Installation installation : installations )
+                {
+                    // combine environments (Master and Slave); Slave's environments overwrite
Master's environments
+                    environments.put( installation.getVarName(), installation.getVarValue()
);
+                }
             }
 
             return environments;

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java?rev=1160979&r1=1160978&r2=1160979&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/test/java/org/apache/continuum/buildagent/manager/BuildAgentReleaseManagerTest.java
Wed Aug 24 05:24:20 2011
@@ -87,6 +87,9 @@ public class BuildAgentReleaseManagerTes
 
                 one( buildAgentConfigurationService ).getWorkingDirectory( 1 );
                 will( returnValue( workingDir ) );
+
+                one( buildAgentConfigurationService ).getAvailableInstallations();
+                will( returnValue( null ) );
             }
         } );
 
@@ -116,6 +119,9 @@ public class BuildAgentReleaseManagerTes
 
                 one( buildAgentConfigurationService ).getWorkingDirectory( 1 );
                 will( returnValue( workingDir ) );
+
+                one( buildAgentConfigurationService ).getAvailableInstallations();
+                will( returnValue( null ) );
             }
         } );
 

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java?rev=1160979&r1=1160978&r2=1160979&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java
Wed Aug 24 05:24:20 2011
@@ -53,7 +53,8 @@ public class SampleClient
         throws Exception
     {
         client = new ContinuumXmlRpcClient( new URL( args[0] ), args[1], args[2] );
-
+        client.removeBuildAgentGroup( "group" );
+/*
 
         // Test for [CONTINUUM-2641]: (test with distributed builds with multiple build agents
or parallel builds with > 1 build queue)
         // make sure to set the projectIds to the actual projectIds of your projects added
in Continuum
@@ -267,7 +268,7 @@ public class SampleClient
         System.out.println( "Removing Local Repository '" + repository.getName() + "' ("
+ 
                             repository.getId() + ")..." );
         client.removeLocalRepository( repository.getId() );
-        System.out.println( "Done." );
+        System.out.println( "Done." );*/
     }
 
     public static void printProjectGroupSummary( ProjectGroupSummary pg )



Mime
View raw message