continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r727937 - in /continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent: continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ continuum-buildagent-core/src/main/java/org/apac...
Date Fri, 19 Dec 2008 06:19:10 GMT
Author: ctan
Date: Thu Dec 18 22:19:09 2008
New Revision: 727937

URL: http://svn.apache.org/viewvc?rev=727937&view=rev
Log:
- added continuum-buildagent-webapp
- more fixes in build agent implementation

Added:
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateWorkingDirectoryAction.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/pom.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/jetty-env.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/continuum-configuration.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/application.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
Modified:
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToBuildDefinition.java

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java?rev=727937&r1=727936&r2=727937&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CheckoutProjectAction.java
Thu Dec 18 22:19:09 2008
@@ -5,11 +5,7 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.continuum.buildagent.buildcontext.BuildContext;
-import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
 import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
-import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
-import org.apache.continuum.buildagent.utils.BuildContextToProject;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.scm.ContinuumScm;
 import org.apache.continuum.scm.ContinuumScmConfiguration;
@@ -31,11 +27,6 @@
     /**
      * @plexus.requirement
      */
-    private BuildContextManager buildContextManager;
-
-    /**
-     * @plexus.requirement
-     */
     private BuildAgentConfigurationService buildAgentConfigurationService;
 
     /**
@@ -46,10 +37,8 @@
     public void execute( Map context )
         throws Exception
     {
-        BuildContext buildContext = buildContextManager.getBuildContext( ContinuumBuildAgentUtil.getProjectId(
context ) );
-        
-        Project project = BuildContextToProject.getProject( buildContext );
-        BuildDefinition buildDefinition = BuildContextToBuildDefinition.getBuildDefinition(
buildContext );
+        Project project = ContinuumBuildAgentUtil.getProject( context );
+        BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context
);
 
         File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId()
);
 

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateWorkingDirectoryAction.java?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateWorkingDirectoryAction.java
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/UpdateWorkingDirectoryAction.java
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,181 @@
+package org.apache.continuum.buildagent.action;
+
+import java.io.File;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
+import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.apache.continuum.scm.ContinuumScm;
+import org.apache.continuum.scm.ContinuumScmConfiguration;
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ScmResult;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+import org.codehaus.plexus.action.AbstractAction;
+
+/**
+ * @plexus.component role="org.codehaus.plexus.action.Action" role-hint="update-agent-working-directory"
+ */
+public class UpdateWorkingDirectoryAction
+    extends AbstractAction
+{
+    /**
+     * @plexus.requirement
+     */
+    private BuildAgentConfigurationService buildAgentConfigurationService;
+
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumScm scm;
+
+    public void execute( Map context )
+        throws Exception
+    {
+        Project project = ContinuumBuildAgentUtil.getProject( context );
+
+        BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context
);
+
+        UpdateScmResult scmResult;
+
+        ScmResult result;
+        
+        try
+        {
+            // TODO: not sure why this is different to the context, but it all needs to change
+            File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId()
);
+            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory
);
+            //config.setLatestUpdateDate( latestUpdateDate );
+            String tag = config.getTag();
+            String msg = project.getName() + "', id: '" + project.getId() + "' to '" +
+                workingDirectory.getAbsolutePath() + "'" + ( tag != null ? " with branch/tag
" + tag + "." : "." );
+            getLogger().info( "Updating project: " + msg );
+            scmResult = scm.update( config );
+
+            if ( !scmResult.isSuccess() )
+            {
+                getLogger().warn( "Error while updating the code for project: '" + msg );
+
+                getLogger().warn( "Command output: " + scmResult.getCommandOutput() );
+
+                getLogger().warn( "Provider message: " + scmResult.getProviderMessage() );
+            }
+
+            if ( scmResult.getUpdatedFiles() != null && scmResult.getUpdatedFiles().size()
> 0 )
+            {
+                getLogger().info( "Updated " + scmResult.getUpdatedFiles().size() + " files."
);
+            }
+
+            result = convertScmResult( scmResult );
+        }
+        catch ( ScmRepositoryException e )
+        {
+            result = new ScmResult();
+
+            result.setSuccess( false );
+
+            result.setProviderMessage( e.getMessage() + ": " + getValidationMessages( e )
);
+            
+            getLogger().error( e.getMessage(), e);
+        }
+        catch ( NoSuchScmProviderException e )
+        {
+            // TODO: this is not making it back into a result of any kind - log it at least.
Same is probably the case for ScmException
+            result = new ScmResult();
+
+            result.setSuccess( false );
+
+            result.setProviderMessage( e.getMessage() );
+            
+            getLogger().error( e.getMessage(), e);
+        }
+        catch ( ScmException e )
+        {
+            result = new ScmResult();
+
+            result.setSuccess( false );
+
+            result.setException( ContinuumBuildAgentUtil.throwableMessagesToString( e ) );
+            
+            getLogger().error( e.getMessage(), e);
+        }
+
+        context.put( ContinuumBuildAgentUtil.KEY_UPDATE_SCM_RESULT, result );
+    }
+
+    private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory
)
+    {
+        ContinuumScmConfiguration config = new ContinuumScmConfiguration();
+        config.setUrl( project.getScmUrl() );
+        config.setUsername( project.getScmUsername() );
+        config.setPassword( project.getScmPassword() );
+        config.setUseCredentialsCache( project.isScmUseCache() );
+        config.setWorkingDirectory( workingDirectory );
+        config.setTag( project.getScmTag() );
+        return config;
+    }
+
+    private ScmResult convertScmResult( UpdateScmResult scmResult )
+    {
+        ScmResult result = new ScmResult();
+
+        result.setCommandLine( maskPassword( scmResult.getCommandLine() ) );
+
+        result.setSuccess( scmResult.isSuccess() );
+
+        result.setCommandOutput( scmResult.getCommandOutput() );
+
+        result.setProviderMessage( scmResult.getProviderMessage() );
+
+        return result;
+    }
+    
+ // TODO: migrate to the SvnCommandLineUtils version (preferably properly encapsulated in
the provider)
+    private String maskPassword( String commandLine )
+    {
+        String cmd = commandLine;
+
+        if ( cmd != null && cmd.startsWith( "svn" ) )
+        {
+            String pwdString = "--password";
+
+            if ( cmd.indexOf( pwdString ) > 0 )
+            {
+                int index = cmd.indexOf( pwdString ) + pwdString.length() + 1;
+
+                int nextSpace = cmd.indexOf( " ", index );
+
+                cmd = cmd.substring( 0, index ) + "********" + cmd.substring( nextSpace );
+            }
+        }
+
+        return cmd;
+    }
+    
+    private String getValidationMessages( ScmRepositoryException ex )
+    {
+        List<String> messages = ex.getValidationMessages();
+
+        StringBuffer message = new StringBuffer();
+
+        if ( messages != null && !messages.isEmpty() )
+        {
+            for ( Iterator<String> i = messages.iterator(); i.hasNext(); )
+            {
+                message.append( i.next() );
+
+                if ( i.hasNext() )
+                {
+                    message.append( System.getProperty( "line.separator" ) );
+                }
+            }
+        }
+        return message.toString();
+    }
+}

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java?rev=727937&r1=727936&r2=727937&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
Thu Dec 18 22:19:09 2008
@@ -60,8 +60,6 @@
             {
                 for ( BuildContext buildContext : buildContexts )
                 {
-                    context = buildContext.getActionContext();
-    
                     BuildDefinition buildDef = BuildContextToBuildDefinition.getBuildDefinition(
buildContext );
         
                     log.info( "Check scm root state" );
@@ -90,6 +88,7 @@
                     finally
                     {
                         endProjectPrepareBuild( buildContext );
+                        context = buildContext.getActionContext();
                     }
                 }
             }
@@ -98,7 +97,7 @@
                 endPrepareBuild( context );
             }
 
-            if ( !checkProjectScmRoot( context ) )
+            if ( checkProjectScmRoot( context ) )
             {
                 buildProjects( buildContexts );
             }
@@ -281,14 +280,22 @@
             result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, ContinuumBuildAgentUtil.getScmRootAddress(
context ) );
             result.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_STATE, new Integer( ContinuumBuildAgentUtil.getScmRootState(
context ) ) );
             
-            String error = convertScmResultToError( ContinuumBuildAgentUtil.getScmResult(
context, null ) );
-            if ( StringUtils.isEmpty( error ) )
+            if ( ContinuumBuildAgentUtil.getScmRootState( context ) == ContinuumProjectState.ERROR
)
             {
-                result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, "" );
+                String error = convertScmResultToError( ContinuumBuildAgentUtil.getScmResult(
context, null ) );
+                
+                if ( StringUtils.isEmpty( error ) )
+                {
+                    result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, "" );
+                }
+                else
+                {
+                    result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, error );
+                }
             }
             else
             {
-                result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, error );
+                result.put( ContinuumBuildAgentUtil.KEY_SCM_ERROR, "" );
             }
     
             // connect to continuum server (master)

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=727937&r1=727936&r2=727937&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
Thu Dec 18 22:19:09 2008
@@ -81,7 +81,7 @@
         {
             Map actionContext = context.getActionContext();
 
-            performAction( "execute-builder", context );
+            performAction( "execute-agent-builder", context );
 
             updateBuildResult( context, null );
         }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToBuildDefinition.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToBuildDefinition.java?rev=727937&r1=727936&r2=727937&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToBuildDefinition.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/BuildContextToBuildDefinition.java
Thu Dec 18 22:19:09 2008
@@ -12,6 +12,8 @@
     {
         BuildDefinition buildDefinition = new BuildDefinition();
 
+        buildDefinition.setId( buildContext.getBuildDefinitionId() );
+
         buildDefinition.setAlwaysBuild( true );
 
         buildDefinition.setArguments( buildContext.getArguments() );

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/pom.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/pom.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/pom.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+    -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>continuum-buildagent</artifactId>
+    <groupId>org.apache.continuum</groupId>
+    <version>1.3.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.continuum</groupId>
+  <artifactId>continuum-buildagent-webapp</artifactId>
+  <packaging>war</packaging>
+  <name>Continuum :: Distributed Build :: Build Agent: Webapp</name>
+  <url>http://continuum.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-distributed-build-transport-slave-server</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-distributed-build-transport-master-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-buildagent-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>2.5.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>      
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-slf4j-logging</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.11</version>
+        <configuration>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <contextPath>/</contextPath>
+          <stopKey>stopkey</stopKey>
+          <stopPort>9192</stopPort>
+          <jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>9191</port>
+              <maxIdleTime>60000</maxIdleTime>
+            </connector>
+          </connectors>
+          <systemProperties>
+            <systemProperty>
+              <name>appserver.base</name>
+              <value>${project.build.directory}/appserver-base</value>
+            </systemProperty>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/jetty-env.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/jetty-env.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/jetty-env.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/jetty-env.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+
+<Configure class="org.mortbay.jetty.webapp.WebAppContext" />

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/java/org/apache/continuum/web/startup/BuildAgentStartup.java
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,40 @@
+package org.apache.continuum.web.startup;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.codehaus.plexus.spring.PlexusToSpringUtils;
+import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+public class BuildAgentStartup
+    implements ServletContextListener
+{
+    private Logger log = LoggerFactory.getLogger( getClass() );
+    
+    /** 
+     * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
+     */
+    public void contextDestroyed( ServletContextEvent sce )
+    {
+        // nothing to do here
+
+    }
+    
+    /** 
+     * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
+     */
+    public void contextInitialized( ServletContextEvent sce )
+    {
+        log.info( "Initializing Build Agent Task Queue Executor" );
+
+        WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(
sce
+            .getServletContext() );
+        
+        TaskQueueExecutor buildAgent = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "build-agent" ) );
+    }
+}

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/continuum-configuration.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/continuum-configuration.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/continuum/continuum-configuration.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <system/>
+  <jndi prefix="java:comp/env" config-optional="true"/>  
+  <xml fileName="${appserver.base}/conf/continuum-buildagent.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum"/>
+  <xml fileName="${user.home}/.m2/continuum-buildagent.xml" config-optional="true"
+       config-forceCreate="true" config-name="org.apache.continuum.user"/>  
+</configuration>

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/application.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/application.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/META-INF/plexus/application.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<plexus>
+  <components>
+   
+    <!--
+     | Logger manager
+     -->
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+    </component>
+
+  </components>
+  
+  <lifecycle-handler-manager implementation="org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager">
+    <default-lifecycle-handler-id>plexus</default-lifecycle-handler-id>
+    <lifecycle-handlers>
+      <lifecycle-handler implementation="org.codehaus.plexus.personality.plexus.PlexusLifecycleHandler">
+        <id>plexus</id>
+        <name>Plexus Lifecycle Handler</name>
+        <begin-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogEnablePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ContextualizePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase"/>
+          <phase implementation="org.codehaus.plexus.registry.RegistryConfigurePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ServiceablePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StartPhase"/>
+        </begin-segment>
+        <suspend-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.SuspendPhase"/>
+        </suspend-segment>
+        <resume-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.ResumePhase"/>
+        </resume-segment>
+        <end-segment>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.StopPhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.DisposePhase"/>
+          <phase implementation="org.codehaus.plexus.personality.plexus.lifecycle.phase.LogDisablePhase"/>
+        </end-segment>
+      </lifecycle-handler>
+    </lifecycle-handlers>
+  </lifecycle-handler-manager>
+</plexus>
\ No newline at end of file

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+  
+  <bean id="slaveBuildAgentTransportServer" class="org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportServer">
+    <constructor-arg ref="continuumBuildAgentService"/>
+  </bean>
+
+  <bean name="xmlrpcServicesList" class="java.util.ArrayList">
+    <constructor-arg>
+      <list>
+        <ref bean="slaveBuildAgentTransportServer"/>
+      </list>
+    </constructor-arg>
+  </bean>
+  
+</beans>

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/log4j.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+  <appender name="console" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="[%p] %-30c{1} - %m%n"/>
+    </layout>
+  </appender>
+  <logger name="org.apache.continuum.buildagent">
+    <level value="info"/>
+  </logger>
+  <logger name="org.apache.continuum.web">
+    <level value="info"/>
+  </logger>
+  <logger name="org.springframework">
+    <level value="error"/>
+  </logger>
+  <root>
+    <priority value ="info" />
+    <appender-ref ref="console" />
+  </root>
+</log4j:configuration>

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,73 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+  <display-name>Continuum Distributed Build Transport Tests</display-name>
+  
+  <listener>
+    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+  </listener>
+  
+  <listener>
+    <!-- TODO: some Spring technique for this? -->
+  	<listener-class>org.apache.continuum.web.startup.BuildAgentStartup</listener-class>
+  </listener>
+  
+  <context-param>
+    <param-name>contextClass</param-name>
+    <param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
+  </context-param>
+  
+  <context-param>
+    <param-name>contextConfigLocation</param-name>
+    <param-value>
+      classpath*:/META-INF/spring-context.xml
+      classpath*:/applicationContext.xml
+      classpath*:/META-INF/plexus/components.xml
+      classpath*:/META-INF/plexus/application.xml
+    </param-value>
+  </context-param>
+  
+  <servlet>
+    <servlet-name>MasterXmlRpcServlet</servlet-name>
+    <servlet-class>
+      com.atlassian.xmlrpc.spring.BinderSpringXmlRpcServlet
+    </servlet-class>
+    <init-param>
+      <param-name>serviceListBeanName</param-name>
+      <param-value>xmlrpcServicesList</param-value>
+    </init-param>
+    <init-param>
+      <param-name>enabledForExtensions</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  
+  <servlet>
+    <servlet-name>SlaveXmlRpcServlet</servlet-name>
+    <servlet-class>
+      com.atlassian.xmlrpc.spring.BinderSpringXmlRpcServlet
+    </servlet-class>
+    <init-param>
+      <param-name>serviceListBeanName</param-name>
+      <param-value>xmlrpcServicesList</param-value>
+    </init-param>
+    <init-param>
+      <param-name>enabledForExtensions</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>MasterXmlRpcServlet</servlet-name>
+    <url-pattern>/master-xmlrpc</url-pattern>
+  </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>SlaveXmlRpcServlet</servlet-name>
+    <url-pattern>/slave-xmlrpc</url-pattern>
+  </servlet-mapping>
+</web-app>

Added: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp?rev=727937&view=auto
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
(added)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/index.jsp
Thu Dec 18 22:19:09 2008
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>



Mime
View raw message