setup skeleton GearmanPlugin.
Change-Id: I9a69f8c4d396f5b0fdab192ec7c8d1d140950060
This commit is contained in:
parent
76db1c3e95
commit
03e1df8f98
|
@ -0,0 +1,3 @@
|
||||||
|
This plugin attempts to integrate Gearman with Jenkins.
|
||||||
|
|
||||||
|
http://wiki.jenkins-ci.org/display/JENKINS/Gearman+Plugin
|
|
@ -0,0 +1 @@
|
||||||
|
mvn -Dmaven.test.skip=true -DskipTests=true clean install
|
|
@ -0,0 +1,2 @@
|
||||||
|
rm -rf work/plugins
|
||||||
|
mvn -Dmaven.test.skip=true -DskipTests=true clean hpi:run
|
|
@ -18,7 +18,78 @@
|
||||||
|
|
||||||
package hudson.plugins.gearman;
|
package hudson.plugins.gearman;
|
||||||
|
|
||||||
|
import hudson.Launcher;
|
||||||
|
import hudson.Extension;
|
||||||
|
import hudson.model.Build;
|
||||||
|
import hudson.model.BuildListener;
|
||||||
|
import hudson.model.AbstractBuild;
|
||||||
|
import hudson.tasks.Builder;
|
||||||
|
import hudson.tasks.BuildStepDescriptor;
|
||||||
|
import org.kohsuke.stapler.StaplerRequest;
|
||||||
|
import org.kohsuke.stapler.DataBoundConstructor;
|
||||||
|
|
||||||
public class GearmanPlugin {
|
import javax.management.Descriptor;
|
||||||
|
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GearmanPlugin {@link Builder}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This sets up the gearman plugin as another plugin in Jenkins
|
||||||
|
* It will allow us to start and stop the gearman workers.
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* @author Khai Do
|
||||||
|
*/
|
||||||
|
public class GearmanPlugin extends Builder {
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@DataBoundConstructor
|
||||||
|
public GearmanPlugin(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescriptorImpl getDescriptor() {
|
||||||
|
|
||||||
|
return (DescriptorImpl)super.getDescriptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Extension
|
||||||
|
public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
|
||||||
|
|
||||||
|
public DescriptorImpl() {
|
||||||
|
load();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return "GearmanPlugin";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isApplicable(Class type) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean configure(StaplerRequest staplerRequest, JSONObject json) throws FormException {
|
||||||
|
|
||||||
|
save();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
|
||||||
|
</j:jelly>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
|
||||||
|
<f:section title="GearmanPlugin">
|
||||||
|
</f:section>
|
||||||
|
</j:jelly>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div>
|
||||||
|
This plugin integrates Gearman with Jenkins.
|
||||||
|
</div>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
This plugin integrates Gearman with Jenkins.
|
||||||
|
</p>
|
||||||
|
</div>
|
Loading…
Reference in New Issue