setup skeleton GearmanPlugin.

Change-Id: I9a69f8c4d396f5b0fdab192ec7c8d1d140950060
This commit is contained in:
Khai Do 2013-01-11 11:52:45 -08:00
parent 76db1c3e95
commit 03e1df8f98
8 changed files with 92 additions and 1 deletions

3
README.txt Normal file
View File

@ -0,0 +1,3 @@
This plugin attempts to integrate Gearman with Jenkins.
http://wiki.jenkins-ci.org/display/JENKINS/Gearman+Plugin

1
install-fast Executable file
View File

@ -0,0 +1 @@
mvn -Dmaven.test.skip=true -DskipTests=true clean install

2
run-fast Executable file
View File

@ -0,0 +1,2 @@
rm -rf work/plugins
mvn -Dmaven.test.skip=true -DskipTests=true clean hpi:run

View File

@ -18,7 +18,78 @@
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;
}
}
}

View File

@ -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>

View File

@ -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>

View File

@ -0,0 +1,3 @@
<div>
This plugin integrates Gearman with Jenkins.
</div>

View File

@ -0,0 +1,5 @@
<div>
<p>
This plugin integrates Gearman with Jenkins.
</p>
</div>