continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r751433 [4/4] - in /continuum/trunk: continuum-api/ continuum-api/src/main/java/org/apache/continuum/release/ continuum-api/src/main/java/org/apache/continuum/release/distributed/ continuum-api/src/main/java/org/apache/continuum/release/dis...
Date Sun, 08 Mar 2009 14:41:35 GMT
Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
Sun Mar  8 14:41:33 2009
@@ -21,6 +21,9 @@
 
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.continuum.release.distributed.DistributedReleaseUtil;
+import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
+import org.apache.continuum.web.action.AbstractReleaseAction;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.system.Profile;
@@ -37,7 +40,9 @@
 
 import java.io.File;
 import java.io.FileReader;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Edwin Punzalan
@@ -45,7 +50,7 @@
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="releasePerform"
  */
 public class ReleasePerformAction
-    extends ContinuumActionSupport
+    extends AbstractReleaseAction
 {
     private int projectId;
 
@@ -80,11 +85,20 @@
     private void init()
         throws Exception
     {
-        Project project = getContinuum().getProject( projectId );
-
-        String workingDirectory = getContinuum().getWorkingDirectory( project.getId() ).getPath();
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
 
-        getReleasePluginParameters( workingDirectory, "pom.xml" );
+            getReleasePluginParameters( distributedReleaseManager.getReleasePluginParameters(
projectId, "pom.xml" ) );
+        }
+        else
+        {
+            Project project = getContinuum().getProject( projectId );
+    
+            String workingDirectory = getContinuum().getWorkingDirectory( project.getId()
).getPath();
+    
+            getReleasePluginParameters( workingDirectory, "pom.xml" );
+        }
     }
 
     public String inputFromScm()
@@ -186,21 +200,30 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        listener = new DefaultReleaseManagerListener();
-
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
-
         Project project = getContinuum().getProject( projectId );
 
-        //todo should be configurable
-        File performDirectory = new File( getContinuum().getConfiguration().getWorkingDirectory(),
-                                          "releases-" + System.currentTimeMillis() );
-        performDirectory.mkdirs();
-
         LocalRepository repository = project.getProjectGroup().getLocalRepository();
 
-        releaseManager.perform( releaseId, performDirectory, goals, arguments, useReleaseProfile,
listener,
-                                repository );
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
+
+            releaseManager.releasePerform( releaseId, goals, arguments, useReleaseProfile,
repository );
+        }
+        else
+        {
+            listener = new DefaultReleaseManagerListener();
+    
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+
+            //todo should be configurable
+            File performDirectory = new File( getContinuum().getConfiguration().getWorkingDirectory(),
+                                              "releases-" + System.currentTimeMillis() );
+            performDirectory.mkdirs();
+
+            releaseManager.perform( releaseId, performDirectory, goals, arguments, useReleaseProfile,
listener,
+                                    repository );
+        }
 
         return SUCCESS;
     }
@@ -208,30 +231,53 @@
     public String executeFromScm()
         throws Exception
     {
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            Project project = getContinuum().getProject( projectId );
 
-        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
-        descriptor.setScmSourceUrl( scmUrl );
-        descriptor.setScmUsername( scmUsername );
-        descriptor.setScmPassword( scmPassword );
-        descriptor.setScmReleaseLabel( scmTag );
-        descriptor.setScmTagBase( scmTagBase );
+            LocalRepository repository = project.getProjectGroup().getLocalRepository();
 
-        if ( profileId != -1 )
-        {
-            Profile profile = getContinuum().getProfileService().getProfile( profileId );
-            descriptor.setEnvironments( releaseManager.getEnvironments( profile ) );
-        }
+            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
+            Map<String, String> environments = new HashMap<String, String>();
+            
+            if ( profileId != -1 )
+            {
+                Profile profile = getContinuum().getProfileService().getProfile( profileId
);
+                environments = getEnvironments( profile );
+            }
+
+            releaseManager.releasePerformFromScm( projectId, goals, arguments, useReleaseProfile,
repository, scmUrl, 
+                                                  scmUsername, scmPassword, scmTag, scmTagBase,
environments );
 
-        do
+            return SUCCESS;
+        }
+        else
         {
-            releaseId = String.valueOf( System.currentTimeMillis() );
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+    
+            ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
+            descriptor.setScmSourceUrl( scmUrl );
+            descriptor.setScmUsername( scmUsername );
+            descriptor.setScmPassword( scmPassword );
+            descriptor.setScmReleaseLabel( scmTag );
+            descriptor.setScmTagBase( scmTagBase );
+    
+            if ( profileId != -1 )
+            {
+                Profile profile = getContinuum().getProfileService().getProfile( profileId
);
+                descriptor.setEnvironments( getEnvironments( profile ) );
+            }
+    
+            do
+            {
+                releaseId = String.valueOf( System.currentTimeMillis() );
+            }
+            while ( releaseManager.getPreparedReleases().containsKey( releaseId ) );
+    
+            releaseManager.getPreparedReleases().put( releaseId, descriptor );
+    
+            return execute();
         }
-        while ( releaseManager.getPreparedReleases().containsKey( releaseId ) );
-
-        releaseManager.getPreparedReleases().put( releaseId, descriptor );
-
-        return execute();
     }
 
     private void populateFromProject()
@@ -255,6 +301,15 @@
         releaseId = "";
     }
 
+    private void getReleasePluginParameters( Map context )
+    {
+        useReleaseProfile = DistributedReleaseUtil.getUseReleaseProfile( context, useReleaseProfile
);
+
+        goals = DistributedReleaseUtil.getGoals( context, goals );
+
+        arguments = DistributedReleaseUtil.getArguments( context, "" );
+    }
+
     public String getReleaseId()
     {
         return releaseId;

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Sun Mar  8 14:41:33 2009
@@ -19,13 +19,18 @@
  * under the License.
  */
 
+import org.apache.continuum.release.distributed.DistributedReleaseUtil;
+import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
+import org.apache.continuum.web.action.AbstractReleaseAction;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.system.Profile;
 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.web.exception.AuthorizationRequiredException;
+import org.apache.maven.continuum.web.model.ReleaseListenerSummary;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@@ -51,7 +56,7 @@
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="releasePrepare"
  */
 public class ReleasePrepareAction
-    extends ContinuumActionSupport
+    extends AbstractReleaseAction
 {
     private static final String SCM_SVN_PROTOCOL_PREFIX = "scm:svn";
 
@@ -101,6 +106,8 @@
 
     private boolean addSchema = true;
 
+    private ReleaseListenerSummary listenerSummary;
+
     public String input()
         throws Exception
     {
@@ -134,8 +141,6 @@
             }
         }
 
-        String workingDirectory = getContinuum().getWorkingDirectory( project.getId() ).getPath();
-
         String scmUrl = project.getScmUrl();
         if ( scmUrl.startsWith( SCM_SVN_PROTOCOL_PREFIX ) )
         {
@@ -148,16 +153,29 @@
             scmTagBase = "";
         }
 
-        prepareGoals = "clean integration-test";
-
-        getReleasePluginParameters( workingDirectory, "pom.xml" );
-
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
         //CONTINUUM-1503
         releaseManager.sanitizeTagName( scmUrl, scmTag );
 
-        processProject( workingDirectory, "pom.xml" );
+        prepareGoals = "clean integration-test";
+
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
+
+            getReleasePluginParameters( distributedReleaseManager.getReleasePluginParameters(
projectId, "pom.xml" ) );
+
+            projects = distributedReleaseManager.processProject( projectId, "pom.xml", autoVersionSubmodules
);
+        }
+        else
+        {
+            String workingDirectory = getContinuum().getWorkingDirectory( project.getId()
).getPath();
+    
+            getReleasePluginParameters( workingDirectory, "pom.xml" );
+    
+            processProject( workingDirectory, "pom.xml" );
+        }
 
         profiles = this.getContinuum().getProfileService().getAllProfiles();
 
@@ -247,10 +265,8 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        listener = new DefaultReleaseManagerListener();
-
         Project project = getContinuum().getProject( projectId );
-
+        
         name = project.getName();
         if ( name == null )
         {
@@ -264,11 +280,39 @@
             profile = getContinuum().getProfileService().getProfile( profileId );
         }
 
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+        Map<String, String> environments = getEnvironments( profile );
 
-        releaseId =
-            releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(), listener,
-                                    profile );
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
+
+            releaseId = distributedReleaseManager.releasePrepare( project, getReleaseProperties(),
getRelVersionMap(), getDevVersionMap(), 
+                                                                  environments );
+        }
+        else
+        {
+            listener = new DefaultReleaseManagerListener();
+
+            String workingDirectory = getContinuum().getWorkingDirectory( projectId ).getPath();
+
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+
+            String executable = getContinuum().getInstallationService()
+                                .getExecutorConfigurator( InstallationService.MAVEN2_TYPE
).getExecutable();
+
+            if ( environments != null )
+            {
+                String m2Home = environments.get( getContinuum().getInstallationService().getEnvVar(
InstallationService.MAVEN2_TYPE ) );
+                if ( StringUtils.isNotEmpty( m2Home ) )
+                {
+                    executable = m2Home + File.separator + "bin" + File.separator + executable;
+                }
+            }
+
+            releaseId =
+                releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(), listener,
+                                        workingDirectory, environments, executable );
+        }
 
         return SUCCESS;
     }
@@ -285,7 +329,15 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        result = (ReleaseResult) getContinuum().getReleaseManager().getReleaseResults().get(
releaseId );
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
+            result = distributedReleaseManager.getReleaseResult( releaseId );
+        }
+        else
+        {
+            result = (ReleaseResult) getContinuum().getReleaseManager().getReleaseResults().get(
releaseId );
+        }
 
         return "viewResult";
     }
@@ -304,28 +356,70 @@
 
         String status;
 
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+        listenerSummary = new ReleaseListenerSummary();
 
-        listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId
);
-
-        if ( listener != null )
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
         {
-            if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+            DistributedReleaseManager distributedReleaseManager = getContinuum().getDistributedReleaseManager();
+            Map listenerMap  = distributedReleaseManager.getListener( releaseId );
+
+            if ( listenerMap != null && !listenerMap.isEmpty() )
             {
-                releaseManager.getListeners().remove( releaseId );
+                int state = DistributedReleaseUtil.getReleaseState( listenerMap );
 
-                result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId
);
+                if ( state == ContinuumReleaseManagerListener.FINISHED )
+                {
+                    distributedReleaseManager.removeListener( releaseId );
+    
+                    result = distributedReleaseManager.getReleaseResult( releaseId );
+    
+                    status = "finished";
+                }
+                else
+                {
+                    status = "inProgress";
+                }
 
-                status = "finished";
+                listenerSummary.setPhases( DistributedReleaseUtil.getReleasePhases( listenerMap
) );
+                listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases(
listenerMap ) );
+                listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress(
listenerMap ) );
+                listenerSummary.setError( DistributedReleaseUtil.getReleaseError( listenerMap
) );
             }
             else
             {
-                status = "inProgress";
+                throw new Exception( "There is no release on-going or finished with id: "
+ releaseId );
             }
         }
         else
         {
-            throw new Exception( "There is no release on-going or finished with id: " + releaseId
);
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+    
+            listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get(
releaseId );
+    
+            if ( listener != null )
+            {
+                if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+                {
+                    releaseManager.getListeners().remove( releaseId );
+    
+                    result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId
);
+    
+                    status = "finished";
+                }
+                else
+                {
+                    status = "inProgress";
+                }
+
+                listenerSummary.setPhases( listener.getPhases() );
+                listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
+                listenerSummary.setInProgress( listener.getInProgress() );
+                listenerSummary.setError( listener.getError() );
+            }
+            else
+            {
+                throw new Exception( "There is no release on-going or finished with id: "
+ releaseId );
+            }
         }
 
         return status;
@@ -446,6 +540,23 @@
         return p;
     }
 
+    private void getReleasePluginParameters( Map context )
+    {
+        scmTag = DistributedReleaseUtil.getScmTag( context, scmTag );
+
+        scmTagBase = DistributedReleaseUtil.getScmTagBase( context, scmTagBase );
+
+        prepareGoals = DistributedReleaseUtil.getPrepareGoals( context, prepareGoals );
+
+        arguments = DistributedReleaseUtil.getArguments( context, "" );
+
+        scmCommentPrefix = DistributedReleaseUtil.getScmCommentPrefix( context, "" );
+
+        autoVersionSubmodules = DistributedReleaseUtil.getAutoVersionSubmodules( context,
false );
+
+        addSchema = DistributedReleaseUtil.getAddSchema( context, true );
+    }
+
     public List<String> getProjectKeys()
     {
         return projectKeys;
@@ -670,4 +781,14 @@
     {
         this.addSchema = addSchema;
     }
+
+    public ReleaseListenerSummary getListenerSummary()
+    {
+        return listenerSummary;
+    }
+
+    public void setListenerSummary( ReleaseListenerSummary listenerSummary )
+    {
+        this.listenerSummary = listenerSummary;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Sun Mar  8 14:41:33 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
@@ -80,16 +81,34 @@
 
         String releaseId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId()
);
 
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
-
-        Map preparedReleases = releaseManager.getPreparedReleases();
-        if ( preparedReleases.containsKey( releaseId ) )
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
         {
-            ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get( releaseId
);
+            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
+            preparedReleaseName = releaseManager.getPreparedReleaseName( releaseId );
 
-            preparedReleaseId = releaseId;
+            if ( StringUtils.isNotBlank( preparedReleaseName ) )
+            {
+                preparedReleaseId = releaseId;
+            }
+            else
+            {
+                preparedReleaseName = null;
+            }
+        }
+        else
+        {
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+    
+            Map preparedReleases = releaseManager.getPreparedReleases();
+            if ( preparedReleases.containsKey( releaseId ) )
+            {
+                ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get(
releaseId );
+    
+                preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
+    
+                preparedReleaseId = releaseId;
+            }
         }
 
         projectName = project.getName();

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectGoalAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectGoalAction.java?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectGoalAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectGoalAction.java
Sun Mar  8 14:41:33 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
@@ -65,16 +66,34 @@
 
         String releaseId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId()
);
 
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
-
-        Map preparedReleases = releaseManager.getPreparedReleases();
-        if ( preparedReleases.containsKey( releaseId ) )
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
         {
-            ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get( releaseId
);
+            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-            preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
+            preparedReleaseName = releaseManager.getPreparedReleaseName( releaseId );
 
-            preparedReleaseId = releaseId;
+            if ( StringUtils.isNotBlank( preparedReleaseName ) )
+            {
+                preparedReleaseId = releaseId;
+            }
+            else
+            {
+                preparedReleaseName = null;
+            }
+        }
+        else
+        {
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+    
+            Map preparedReleases = releaseManager.getPreparedReleases();
+            if ( preparedReleases.containsKey( releaseId ) )
+            {
+                ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get(
releaseId );
+    
+                preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
+    
+                preparedReleaseId = releaseId;
+            }
         }
 
         projectName = project.getName();

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
Sun Mar  8 14:41:33 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.continuum.model.project.Project;
@@ -61,29 +62,38 @@
             return REQUIRES_AUTHORIZATION;
         }
 
-        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
-
-        ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
-
-        Project project = getContinuum().getProject( projectId );
-
-        releaseManager.rollback( releaseId, workingDirectoryService.getWorkingDirectory(
project ).getPath(), listener );
+        if ( getContinuum().getConfiguration().isDistributedBuildEnabled() )
+        {
+            DistributedReleaseManager releaseManager = getContinuum().getDistributedReleaseManager();
 
-        //recurse until rollback is finished
-        while ( listener.getState() != ContinuumReleaseManagerListener.FINISHED )
+            releaseManager.releaseRollback( releaseId, projectId );
+        }
+        else
         {
-            try
-            {
-                Thread.sleep( 1000 );
-            }
-            catch ( InterruptedException e )
+            ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+    
+            ContinuumReleaseManagerListener listener = new DefaultReleaseManagerListener();
+    
+            Project project = getContinuum().getProject( projectId );
+    
+            releaseManager.rollback( releaseId, workingDirectoryService.getWorkingDirectory(
project ).getPath(), listener );
+    
+            //recurse until rollback is finished
+            while ( listener.getState() != ContinuumReleaseManagerListener.FINISHED )
             {
-                //do nothing
+                try
+                {
+                    Thread.sleep( 1000 );
+                }
+                catch ( InterruptedException e )
+                {
+                    //do nothing
+                }
             }
+    
+            releaseManager.getPreparedReleases().remove( releaseId );
         }
 
-        releaseManager.getPreparedReleases().remove( releaseId );
-
         return SUCCESS;
     }
 

Modified: continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo (original)
+++ continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo Sun Mar  8 14:41:33 2009
@@ -535,5 +535,41 @@
         </field>
       </fields>
     </class>
+    <class>
+      <name>ReleaseListenerSummary</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>phases</name>
+          <version>1.0.0</version>
+          <required>true</required>
+          <description>Release Phases</description>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+        <field>
+          <name>completedPhases</name>
+          <version>1.0.0</version>
+          <description>Completed release phases</description>
+          <association>
+            <type>String</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+        <field>
+          <name>inProgress</name>
+          <version>1.0.0</version>
+          <description>Release phase in progress</description> 
+          <type>String</type>
+        </field>
+        <field>
+          <name>error</name>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>
   </classes>
 </model>

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Sun Mar  8 14:41:33 2009
@@ -659,6 +659,7 @@
 releasePrepare.section.title=Prepare Project for Release
 releasePrepare.releaseVersion=Release Version*
 releasePrepare.nextDevelopmentVersion=Next Development Version*
+releasePrepare.parameters=Release Prepare Parameters
 releasePerform.section.title=Perform Project Release
 releasePerform.parameters=Release Perform Parameters
 releaseInProgress.section.title=Executing Release Goal

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp Sun Mar
 8 14:41:33 2009
@@ -32,15 +32,15 @@
             <th><s:text name="releaseInProgress.status"/></th>
             <th width="100%"><s:text name="releaseInProgress.phase"/></th>
           </tr>
-          <s:iterator value="listener.phases">
+          <s:iterator value="listenerSummary.phases">
             <tr>
               <td>
-              <s:if test="listener.completedPhases.contains( top )">
+              <s:if test="listenerSummary.completedPhases.contains( top )">
                 <img src="<s:url value='/images/icon_success_sml.gif' includeParams="none"/>"
                      alt="Done" title="Done" border="0">
               </s:if>
-              <s:elseif test="listener.inProgress.equals( top )">
-                <s:if test="listener.error == null">
+              <s:elseif test="listenerSummary.inProgress.equals( top )">
+                <s:if test="listenerSummary.error == null">
                   <img src="<s:url value='/images/building.gif' includeParams="none"/>"
                        alt="In Progress" title="In Progress" border="0">
                 </s:if>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp?rev=751433&r1=751432&r2=751433&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp Sun
Mar  8 14:41:33 2009
@@ -33,15 +33,15 @@
             <th><s:text name="releaseInProgress.status"/></th>
             <th width="100%"><s:text name="releaseInProgress.phase"/></th>
           </tr>
-          <s:iterator value="listener.phases">
+          <s:iterator value="listenerSummary.phases">
             <tr>
               <td>
-              <s:if test="listener.completedPhases.contains( top )">
+              <s:if test="listenerSummary.completedPhases.contains( top )">
                 <img src="<s:url value='/images/icon_success_sml.gif' includeParams="none"/>"
                      alt="Done" title="Done" border="0">
               </s:if>
-              <s:elseif test="listener.inProgress.equals( top )">
-                <s:if test="listener.error == null">
+              <s:elseif test="listenerSummary.inProgress.equals( top )">
+                <s:if test="listenerSummary.error == null">
                   <img src="<s:url value='/images/building.gif' includeParams="none"/>"
                        alt="In Progress" title="In Progress" border="0">
                 </s:if>



Mime
View raw message