continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r442602 - in /maven/continuum/branches/release-integration/continuum: continuum-release/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/apache/maven/continuum/release/executors/ continuum-webapp/src/mai...
Date Tue, 12 Sep 2006 14:55:17 GMT
Author: epunzalan
Date: Tue Sep 12 07:55:16 2006
New Revision: 442602

URL: http://svn.apache.org/viewvc?view=rev&rev=442602
Log:
PR: CONTINUUM-727

tested and working release:perform

Added:
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
  (with props)
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
  (contents, props changed)
      - copied, changed from r442050, maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseFinished.jsp
Removed:
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseFinished.jsp
Modified:
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseProgress.jsp
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Tue Sep 12 07:55:16 2006
@@ -54,8 +54,9 @@
 
     /**
      * contains previous release:prepare descriptors; one per project
+     * @todo remove static when singleton strategy is working
      */
-    private Map preparedReleases;
+    private static Map preparedReleases;
 
     public String prepare( Project project, Properties releaseProperties, Map relVersions,
                            Map devVersions, ContinuumReleaseManagerListener listener )

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
Tue Sep 12 07:55:16 2006
@@ -42,7 +42,6 @@
 
     public void goalStart( String name, List phases )
     {
-        System.out.println( "Goal started: " + name + "; phases: " + phases.size() );
         state = LISTENING;
         goalName = name;
         this.phases = phases;
@@ -52,7 +51,6 @@
 
     public void phaseStart( String name )
     {
-        System.out.println( goalName + ":" + name + " started." );
         inProgress = name;
     }
 
@@ -65,19 +63,16 @@
 
     public void phaseSkip( String name )
     {
-        System.out.println( goalName + ":" + name + " skipped." );
         completedPhases.add( name );
     }
 
     public void goalEnd()
     {
         state = FINISHED;
-        System.out.println( goalName + " finished." );
     }
 
     public void error( String message )
     {
-        System.out.println( goalName + " error occurred: " + message );
         error = message;
         goalEnd();
     }

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
Tue Sep 12 07:55:16 2006
@@ -46,8 +46,6 @@
                                           false, false, listener );
 
             continuumReleaseManager.getPreparedReleases().put( prepareTask.getReleaseId(),
descriptor );
-
-            System.out.println( "========== new prepared release: " + prepareTask.getReleaseId()
+ "============" );
         }
         catch ( ReleaseExecutionException e )
         {

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
Tue Sep 12 07:55:16 2006
@@ -19,10 +19,12 @@
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
+import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import java.util.Map;
 
 /**
  * @author Edwin Punzalan
@@ -34,6 +36,8 @@
 public class PerformReleaseAction
     extends ContinuumActionSupport
 {
+    private int projectId;
+
     private String releaseId;
 
     private String scmUrl;
@@ -55,11 +59,28 @@
     public String execute()
         throws Exception
     {
-        if ( StringUtils.isNotEmpty( releaseId ) )
+        if ( StringUtils.isNotEmpty( releaseId )  )
         {
             ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
-            ReleaseDescriptor descriptor = (ReleaseDescriptor) releaseManager.getPreparedReleases().get(
releaseId );
-            scmUrl = descriptor.getScmSourceUrl();
+
+            Map preparedReleases = releaseManager.getPreparedReleases();
+            if ( preparedReleases.containsKey( releaseId ) )
+            {
+                ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get(
releaseId );
+                scmUrl = descriptor.getScmSourceUrl();
+                scmUsername = descriptor.getScmUsername();
+                scmPassword = descriptor.getScmPassword();
+                scmTag = descriptor.getScmReleaseLabel();
+                scmTagBase = descriptor.getScmTagBase();
+            }
+            else
+            {
+                populateFromProject();
+            }
+        }
+        else
+        {
+            populateFromProject();
         }
 
         return "prompt";
@@ -72,6 +93,7 @@
 
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
+        //todo should be configurable
         File performDirectory = new File( getContinuum().getConfiguration().getWorkingDirectory(),
                                           "releases-" + System.currentTimeMillis() );
         performDirectory.mkdirs();
@@ -123,6 +145,18 @@
         }
 
         return status;
+    }
+
+    private void populateFromProject()
+        throws Exception
+    {
+        Project project = getContinuum().getProjectWithAllDetails( projectId );
+
+        scmUrl = project.getScmUrl();
+        scmUsername = project.getScmUsername();
+        scmPassword = project.getScmPassword();
+
+        releaseId = "";
     }
 
     public String getReleaseId()

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
Tue Sep 12 07:55:16 2006
@@ -113,9 +113,11 @@
 
         listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId
);
 
-        if ( listener.getState() == ContinuumReleaseManagerListener.INITIALIZED )
+        if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
         {
-            status = "initialized";
+            releaseManager.getListeners().remove( releaseId );
+
+            status = "finished";
         }
         else if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
         {
@@ -123,9 +125,7 @@
         }
         else
         {
-            releaseManager.getListeners().remove( releaseId );
-
-            return "finished";
+            status = "initialized";
         }
 
         return status;

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Tue Sep 12 07:55:16 2006
@@ -20,9 +20,7 @@
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
-import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -40,6 +38,8 @@
 
     private String preparedReleaseName;
 
+    private String preparedReleaseId;
+
     private String goal;
 
     private String scmUrl;
@@ -57,14 +57,14 @@
 
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
-        releaseList = new ArrayList( releaseManager.getPreparedReleases().values() );
-
         Map preparedReleases = releaseManager.getPreparedReleases();
         if ( preparedReleases.containsKey( releaseId ) )
         {
             ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get( releaseId
);
 
             preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
+
+            preparedReleaseId = releaseId;
         }
 
         return "prompt";
@@ -79,13 +79,6 @@
         }
         else if ( "perform".equals( goal ) )
         {
-            if ( StringUtils.isNotEmpty( preparedReleaseName ) )
-            {
-                project = getContinuum().getProjectWithAllDetails( projectId );
-
-                scmUrl = project.getScmUrl();
-            }
-
             return "performRelease";
         }
         else
@@ -142,5 +135,25 @@
     public void setScmUrl( String scmUrl )
     {
         this.scmUrl = scmUrl;
+    }
+
+    public List getReleaseList()
+    {
+        return releaseList;
+    }
+
+    public void setReleaseList( List releaseList )
+    {
+        this.releaseList = releaseList;
+    }
+
+    public String getPreparedReleaseId()
+    {
+        return preparedReleaseId;
+    }
+
+    public void setPreparedReleaseId( String preparedReleaseId )
+    {
+        this.preparedReleaseId = preparedReleaseId;
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
Tue Sep 12 07:55:16 2006
@@ -306,6 +306,7 @@
       <result name="performRelease" type="redirect-action">
         <param name="actionName">performRelease</param>
         <param name="projectId">${projectId}</param>
+        <param name="releaseId">${preparedReleaseId}</param>
       </result>
     </action>
 
@@ -318,18 +319,18 @@
         <param name="projectId">${projectId}</param>
       </result>
       <result name="inProgress">prepareReleaseProgress.jsp</result>
-      <result name="finished">releaseFinished.jsp</result>
+      <result name="finished">prepareReleaseFinished.jsp</result>
     </action>
 
     <action name="performRelease" class="performRelease">
       <result name="prompt">performRelease.jsp</result>
       <!-- should be exec and wait -->
       <result name="initialized" type="redirect-action">
-        <param name="actionName">prepareRelease!checkProgress.action</param>
+        <param name="actionName">performRelease!checkProgress.action</param>
         <param name="releaseId">${releaseId}</param>
       </result>
       <result name="inProgress">performReleaseProgress.jsp</result>
-      <result name="finished">releaseFinished.jsp</result>
+      <result name="finished">performReleaseFinished.jsp</result>
     </action>
 
   </package>

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
Tue Sep 12 07:55:16 2006
@@ -11,14 +11,17 @@
       <h2>Perform Project Release</h2>
       <ww:form action="performRelease!doPerform.action" method="post">
         <h3>Common Release Parameters</h3>
-        <input type="hidden" name="projectId" value="<ww:property value="projectId"/>"/>
+        <ww:hidden name="projectId"/>
+        <ww:hidden name="releaseId"/>
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
-            <ww:textfield label="SCM Connection URL" name="scmUrl"/>
-            <ww:textfield label="SCM Username" name="scmUsername"/>
-            <ww:textfield label="SCM Password" name="scmPassword"/>
-            <ww:textfield label="SCM Tag" name="scmTag"/>
-            <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
+            <ww:if test="releaseId.length == 0">
+              <ww:textfield label="SCM Connection URL" name="scmUrl"/>
+              <ww:textfield label="SCM Username" name="scmUsername"/>
+              <ww:textfield label="SCM Password" name="scmPassword"/>
+              <ww:textfield label="SCM Tag" name="scmTag"/>
+              <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
+            </ww:if>
             <ww:textfield label="Maven Arguments" name="goals"/>
             <ww:checkbox label="Use Release Profile" name="useReleaseProfile" value="true"/>
           </table>

Added: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp?view=auto&rev=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
Tue Sep 12 07:55:16 2006
@@ -0,0 +1,45 @@
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="releaseProject.page.title"/></title>
+    </head>
+    <body>
+      <h2>Continuum Release</h2>
+      <h3><ww:property value="name"/></h3>
+      <ww:form action="groupSummary" method="post">
+        <div class="axial">
+          <table width="100%">
+            <tr>
+              <th>Status</th>
+              <th>Phase</th>
+            </tr>
+            <ww:iterator value="listener.phases">
+              <tr>
+                <ww:if test="listener.completedPhases.contains( top )">
+                  <td>done</td>
+                </ww:if>
+                <ww:elseif test="listener.inProgress.equals( top )">
+                  <ww:if test="listener.error == null">
+                    <td>in progress</td>
+                  </ww:if>
+                  <ww:else>
+                    <td>error</td>
+                  </ww:else>
+                </ww:elseif>
+                <ww:else>
+                  <td>not done</td>
+                </ww:else>
+                <td><ww:property/></td>
+              </tr>
+            </ww:iterator>
+          </table>
+        </div>
+        <ww:submit value="Done"/>
+      </ww:form>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseProgress.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseProgress.jsp?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseProgress.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseProgress.jsp
Tue Sep 12 07:55:16 2006
@@ -11,6 +11,7 @@
       <h2>Continuum Release</h2>
       <h3><ww:property value="name"/></h3>
       <ww:form action="performRelease!checkProgress.action" method="post">
+        <ww:hidden name="projectId"/>
         <ww:hidden name="releaseId"/>
         <div class="axial">
           <table width="100%">

Copied: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
(from r442050, maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseFinished.jsp)
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp?view=diff&rev=442602&p1=maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseFinished.jsp&r1=442050&p2=maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp&r2=442602
==============================================================================
    (empty)

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp?view=diff&rev=442602&r1=442601&r2=442602
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
Tue Sep 12 07:55:16 2006
@@ -16,18 +16,13 @@
           <input name="goal" type="radio" value="perform"/>Perform project release
           <br/>
           &nbsp;&nbsp;&nbsp;
-          <select name="preparedReleaseName">
-            <ww:iterator value="releaseList">
-              <option value="<ww:property/>">
-                <ww:property/>
-              </option>
-            </ww:iterator>
+          <select name="preparedReleaseId">
             <ww:if test="preparedReleaseName != null">
-              <option selected value="<ww:property value="preparedReleaseName"/>">
+              <option selected value="<ww:property value="preparedReleaseId"/>">
                 <ww:property value="preparedReleaseName"/>
               </option>
             </ww:if>
-            <option value="none">Provide release descriptor</option>
+            <option value="">Provide release descriptor</option>
           </select>
           <br/>
         </p>



Mime
View raw message