提交 029f6715 编写于 作者: K kohsuke

[FIXED HUDSON-3087] Purging workspace in Matrix job should purge all...

[FIXED HUDSON-3087] Purging workspace in Matrix job should purge all configuration workspaces, too. In 1.316.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19589 71c3de6d-444a-0410-be80-ed276b4c234a
上级 6d3ed4c1
......@@ -319,7 +319,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler-jelly</artifactId>
<version>1.106</version>
<version>1.107</version>
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
......
......@@ -78,6 +78,7 @@ import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.HttpResponse;
/**
* {@link Job} that allows you to run multiple different configurations
......@@ -542,6 +543,17 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
rebuildConfigurations();
}
/**
* Also delete all the workspaces of the configuration, too.
*/
@Override
public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException {
HttpResponse rsp = super.doDoWipeOutWorkspace();
for (MatrixConfiguration c : configurations.values())
c.doDoWipeOutWorkspace();
return rsp;
}
public DescriptorImpl getDescriptor() {
return DESCRIPTOR;
}
......
......@@ -61,6 +61,9 @@ import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.ForwardToView;
import javax.servlet.ServletException;
......@@ -1251,29 +1254,28 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
/**
* Wipes out the workspace.
*/
public void doDoWipeOutWorkspace(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException {
checkPermission(BUILD);
if (getScm().processWorkspaceBeforeDeletion(this, getWorkspace(), null)) {
getWorkspace().deleteRecursive();
rsp.sendRedirect2(".");
}
// If we get here, that means the SCM blocked the workspace deletion.
else {
req.getView(this, "wipeOutWorkspaceBlocked.jelly").forward(req, rsp);
return new HttpRedirect(".");
} else {
// If we get here, that means the SCM blocked the workspace deletion.
return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly");
}
}
public void doDisable(StaplerResponse rsp) throws IOException, ServletException {
public HttpResponse doDisable() throws IOException, ServletException {
requirePOST();
checkPermission(CONFIGURE);
makeDisabled(true);
rsp.sendRedirect2(".");
return new HttpRedirect(".");
}
public void doEnable(StaplerResponse rsp) throws IOException, ServletException {
public HttpResponse doEnable() throws IOException, ServletException {
checkPermission(CONFIGURE);
makeDisabled(false);
rsp.sendRedirect2(".");
return new HttpRedirect(".");
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册