continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r722393 - in /continuum/branches/continuum-distributed-builds: continuum-core/src/main/java/org/apache/continuum/distributed/manager/ continuum-security/src/main/resources/META-INF/redback/ continuum-webapp/src/main/java/org/apache/continuu...
Date Tue, 02 Dec 2008 07:37:03 GMT
Author: ctan
Date: Mon Dec  1 23:37:03 2008
New Revision: 722393

URL: http://svn.apache.org/viewvc?rev=722393&view=rev
Log:
more fix

Added:
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
      - copied, changed from r722280, continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/addBuildAgent.jsp
Removed:
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/addBuildAgent.jsp
Modified:
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/distributed/manager/DefaultDistributedBuildManager.java
    continuum/branches/continuum-distributed-builds/continuum-security/src/main/resources/META-INF/redback/redback.xml
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedBuildAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/mdo/view-models.mdo
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/struts.xml
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildAgentsList.jsp
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/distributed/manager/DefaultDistributedBuildManager.java?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/distributed/manager/DefaultDistributedBuildManager.java
Mon Dec  1 23:37:03 2008
@@ -112,6 +112,7 @@
     
                     if ( !found )
                     {
+                        // ping it 
                         BuildAgent buildAgent = new BuildAgent();
                         buildAgent.setUrl( agent.getUrl() );
                         buildAgent.setBusy( false );
@@ -202,7 +203,17 @@
                 List buildContext = initializeBuildContext( projectsAndBuildDefinitionsMap,
trigger, buildAgent );
 
                 //BuildAgentXMLRpcClient client = new BuildAgentXmlRpcClient( buildAgent.getUrl(),
null, null );
-                //client.buildProjects( buildContext );
+                
+                //try
+                //{
+                    //client.buildProjects( buildContext );
+                //}
+                //catch ( InterruptedException e )
+                //{
+                    //do something about the server Url
+                    //client.getServerUrl();
+                    //get projects of buildagent and set to build error the first project.
+                //}
                 log.info( "dispatched build to " + buildAgent.getUrl() );
                 found = true;
             }

Modified: continuum/branches/continuum-distributed-builds/continuum-security/src/main/resources/META-INF/redback/redback.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-security/src/main/resources/META-INF/redback/redback.xml?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-security/src/main/resources/META-INF/redback/redback.xml
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-security/src/main/resources/META-INF/redback/redback.xml
Mon Dec  1 23:37:03 2008
@@ -165,6 +165,11 @@
   		      <name>continuum-manage-purging</name>
   		      <description>Continuum Manage Purging</description>
   		    </operation>
+  		    <operation>
+  		      <id>continuum-manage-distributed-builds</id>
+  		      <name>continuum-manage-distributed-builds</name>
+  		      <description>Continuum Manage Distributed Builds</description>
+  		    </operation>
   		  </operations>
   		  <roles>
   		    <role>
@@ -180,6 +185,13 @@
   		          <operation>continuum-manage-configuration</operation>
   		          <resource>global</resource>
   		        </permission>
+  		        <permission>
+  		          <id>continuum-manage-distributed-builds</id>
+  		          <name>Manage Distributed Builds</name>
+  		          <permanent>true</permanent>
+  		          <operation>continuum-manage-distributed-builds</operation>
+  		          <resource>global</resource>
+  		        </permission>
   		      </permissions>
   		      <parentRoles>
   		        <parentRole>system-administrator</parentRole>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
Mon Dec  1 23:37:03 2008
@@ -20,12 +20,15 @@
  */
 
 import org.apache.continuum.configuration.BuildAgentConfiguration;
+import org.apache.continuum.distributed.BuildAgent;
+import org.apache.continuum.distributed.manager.DistributedBuildManager;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
 import org.apache.struts2.ServletActionContext;
 import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
@@ -40,6 +43,11 @@
     extends ContinuumConfirmAction
     implements SecureAction
 {
+    /**
+     * @plexus.requirement
+     */
+    private DistributedBuildManager distributedBuildManager;
+    
     private List<BuildAgentConfiguration> buildAgents;
 
     private BuildAgentConfiguration buildAgent;
@@ -50,6 +58,25 @@
 
     private String message;
 
+    public String input()
+        throws Exception
+    {
+        if ( buildAgent != null && StringUtils.isBlank( buildAgent.getUrl() ) )
+        {
+            List<BuildAgentConfiguration> agents = getContinuum().getConfiguration().getBuildAgents();
+            
+            for ( BuildAgentConfiguration agent : agents )
+            {
+                if ( agent.getUrl().equals( buildAgent.getUrl() ) )
+                {
+                    buildAgent = agent;
+                }
+            }
+        }
+
+        return INPUT;
+    }
+
     public String list()
         throws Exception
     {
@@ -61,6 +88,7 @@
         }
 
         this.buildAgents = getContinuum().getConfiguration().getBuildAgents();
+
         return SUCCESS;
     }
 
@@ -100,6 +128,8 @@
 
         configuration.addBuildAgent( buildAgent );
 
+        distributedBuildManager.reload();
+
         return SUCCESS;
     }
 
@@ -110,7 +140,26 @@
         {
             return CONFIRM;
         }
-        
+
+        List<BuildAgent> agents = distributedBuildManager.getBuildAgents();
+
+        for ( BuildAgent agent : agents )
+        {
+            if ( agent.getUrl().equals( buildAgent.getUrl() ) )
+            {
+                if ( agent.isBusy() )
+                {
+                    message = "buildAgent.error.delete.busy";
+                    return ERROR;
+                }
+                else
+                {
+                    agents.remove( agent );
+                    break;
+                }
+            }
+        }
+
         ConfigurationService configuration = getContinuum().getConfiguration();
 
         for ( BuildAgentConfiguration agent : configuration.getBuildAgents() )

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedBuildAction.java?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedBuildAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/DistributedBuildAction.java
Mon Dec  1 23:37:03 2008
@@ -19,8 +19,6 @@
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
Mon Dec  1 23:37:03 2008
@@ -59,6 +59,8 @@
 
     private boolean requireReleaseOutput;
 
+    private boolean distributedBuildEnabled;
+
     public void prepare()
     {
         ConfigurationService configuration = getContinuum().getConfiguration();
@@ -99,6 +101,8 @@
         
         String requireRelease = ServletActionContext.getRequest().getParameter( "requireReleaseOutput"
);
         setRequireReleaseOutput( new Boolean( requireRelease ) );
+
+        distributedBuildEnabled = configuration.isDistributedBuildEnabled();
     }
 
     public String input()
@@ -147,6 +151,8 @@
             configuration.setReleaseOutputDirectory( null );
         }
 
+        configuration.setDistributedBuildEnabled( distributedBuildEnabled );
+
         configuration.store();
 
         return SUCCESS;
@@ -221,4 +227,14 @@
     {
         this.requireReleaseOutput = requireReleaseOutput;
     }
+
+    public boolean isDistributedBuildEnabled()
+    {
+        return distributedBuildEnabled;
+    }
+
+    public void setDistributedBuildEnabled( boolean distributedBuildEnabled )
+    {
+        this.distributedBuildEnabled = distributedBuildEnabled;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/mdo/view-models.mdo
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/mdo/view-models.mdo?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/mdo/view-models.mdo
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/mdo/view-models.mdo
Mon Dec  1 23:37:03 2008
@@ -475,5 +475,49 @@
         </field>
       </fields>
     </class>    
+    <class>
+      <name>BuildAgentSummary</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>url</name>
+          <version>1.0.0</version>
+          <required>true</required>
+          <description>URL of the build agent</description>
+          <type>String</type>
+        </field>
+        <field>
+          <name>description</name>
+          <version>1.0.0</version>
+          <required>false</required>
+          <description>Description of the build agent</description>
+          <type>String</type>
+        </field>
+        <field>
+          <name>enabled</name>
+          <version>1.0.0</version>
+          <required>true</required>
+          <description>Determines if the build agent is enabled</description>
+          <type>boolean</type>
+        </field>
+        <field>
+          <name>busy</name>
+          <version>1.0.0</version>
+          <required>true</required>
+          <description>Determines if the build agent is busy</description>
+          <type>boolean</type>
+        </field>
+        <field>
+          <name>projects</name>
+          <version>1.0.0</version>
+          <description></description>
+          <required>false</required>
+          <association>
+            <type>ProjectSummary</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+    </class>
   </classes>
 </model>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/struts.xml?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/struts.xml
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/struts.xml
Mon Dec  1 23:37:03 2008
@@ -863,6 +863,11 @@
       <result name="success">/WEB-INF/jsp/admin/buildAgentsList.jsp</result>
     </action>
     
+    <action name="editBuildAgent" class="buildAgent" method="input">
+      <result name="input">/WEB-INF/jsp/admin/editBuildAgent.jsp</result>
+      <result name="error">/WEB-INF/jsp/admin/editBuildAgent.jsp</result>
+    </action>
+    
     <action name="saveBuildAgent" class="buildAgent" method="save">
       <result name="input">/WEB-INF/jsp/admin/addBuildAgent.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/addBuildAgent.jsp</result>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildAgentsList.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildAgentsList.jsp?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildAgentsList.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildAgentsList.jsp
Mon Dec  1 23:37:03 2008
@@ -52,19 +52,27 @@
             </ec:column>
             <ec:column property="enabled" title="buildAgents.table.enabled"/>
             <ec:column property="description" title="buildAgents.table.description"/>
+            <ec:column property="editActions" title="&nbsp;" width="1%">
+              <s:url id="editBuildAgentUrl" action="editBuildAgent">
+                <s:param name="buildAgent.url">${pageScope.buildAgent.url}</s:param>
+              </s:url>
+              <s:a href="%{editBuildAgentUrl}">
+                <img src="<s:url value='/images/edit.gif' includeParams="none"/>"
alt="<s:text name='edit'/>" title="<s:text name='edit'/>" border="0"/>
+              </s:a>
+            </ec:column>
             <ec:column property="deleteActions" title="&nbsp;" width="1%">
               <s:url id="removeBuildAgentUrl" action="removeBuildAgent">
                 <s:param name="buildAgent.url">${pageScope.buildAgent.url}</s:param>
               </s:url>
               <s:a href="%{removeBuildAgentUrl}">
-                <img src="<s:url value='/images/delete.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" border="0">
+                <img src="<s:url value='/images/delete.gif' includeParams="none"/>"
alt="<s:text name='delete'/>" title="<s:text name='delete'/>" border="0"/>
               </s:a>
             </ec:column>
           </ec:row>
         </ec:table>
       </div>
       <div class="functnbar3">
-        <s:form action="addBuildAgent" method="post">
+        <s:form name="addBuildAgent" action="editBuildAgent" method="post">
           <s:submit value="%{getText('add')}"/>
         </s:form>
       </div>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
Mon Dec  1 23:37:03 2008
@@ -40,6 +40,7 @@
         <c1:data label="%{getText('configuration.deploymentRepositoryDirectory.label')}"
                  name="deploymentRepositoryDirectory"/>
         <c1:data label="%{getText('configuration.baseUrl.label')}" name="baseUrl"/>
+        <c1:data label="%{getText('configuration.distributedBuildEnabled.label')}" name="distributedBuildEnabled"/>
       </table>
       <div class="functnbar3">
         <s:form action="configuration!input.action" method="post">

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Mon Dec  1 23:37:03 2008
@@ -83,6 +83,11 @@
               </p></s:param>
             </s:textfield>
 
+		    <s:checkbox label="%{getText('configuration.distributedBuildEnabled.label')}" name="distributedBuildEnabled">
+		      <s:param name="desc"><p>
+		        <s:text name="configuration.distributedBuildEnabled.label"/>
+		      </p></s:param>
+		    </s:checkbox>
             <s:hidden name="requireReleaseOutput"/>
           </tbody>
         </table>

Copied: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
(from r722280, continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/addBuildAgent.jsp)
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp?p2=continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp&p1=continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/addBuildAgent.jsp&r1=722280&r2=722393&rev=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/addBuildAgent.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildAgent.jsp
Mon Dec  1 23:37:03 2008
@@ -45,7 +45,7 @@
               <s:textfield label="%{getText('buildAgent.description.label')}" name="buildAgent.description"/>
               <s:checkbox label="%{getText('buildAgent.enabled.label')}" name="enabled"
value="enabled" fieldValue="true"/>
             </table>
-          
+            <s:hidden name="buildAgent.url"/>
             <div class="functnbar3">
               <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
             </div>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp?rev=722393&r1=722392&r2=722393&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
Mon Dec  1 23:37:03 2008
@@ -158,6 +158,14 @@
             </s:a>
           </div>
         </redback:ifAuthorized>
+          <s:url id="buildAgentList" action="buildAgentList" namespace="/security" includeParams="none"/>
+          <div class="body">
+            <s:a href="%{buildAgentList}">
+              <s:text name="menu.administration.buildAgents"/>
+            </s:a>
+          </div>
+        <redback:ifAuthorized permission="continuum-manage-distributed-builds">
+        </redback:ifAuthorized>
         <redback:ifAuthorized permission="continuum-manage-users">
           <s:url id="userListUrl" action="userlist" namespace="/security" includeParams="none"/>
           <div class="body">



Mime
View raw message