mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
added script console for slaves
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8208 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9e1ec88a34
commit
6ce16cbcb3
3 files changed
+30
No files matched your search
@@ -340,6 +340,24 @@ public abstract class Computer extends AbstractModelObject {
|
||||
w.close();
|
||||
}
|
||||
|
||||
public void doScript( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
|
||||
// ability to run arbitrary script is dangerous,
|
||||
// so tie it to the admin access
|
||||
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
|
||||
|
||||
String text = req.getParameter("script");
|
||||
if(text!=null) {
|
||||
try {
|
||||
req.setAttribute("output",
|
||||
RemotingDiagnostics.executeGroovy(text,getChannel()));
|
||||
} catch (InterruptedException e) {
|
||||
throw new ServletException(e);
|
||||
}
|
||||
}
|
||||
|
||||
req.getView(this,"_script.jelly").forward(req,rsp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current {@link Computer} that the build is running.
|
||||
* This method only works when called during a build, such as by
|
||||
|
||||
Reference in new issue
Block a user