Index: src/main/java/hudson/plugins/build_publisher/BuildPublisher.java =================================================================== --- src/main/java/hudson/plugins/build_publisher/BuildPublisher.java (revision 32583) +++ src/main/java/hudson/plugins/build_publisher/BuildPublisher.java (working copy) @@ -9,7 +9,6 @@ import hudson.model.AbstractProject; import hudson.model.BuildListener; import hudson.model.Descriptor; -import hudson.model.Descriptor.FormException; import hudson.model.Hudson; import hudson.model.Result; import hudson.tasks.BuildStepDescriptor; @@ -111,6 +110,7 @@ BuildStepDescriptor { private HudsonInstance[] publicInstances = new HudsonInstance[0]; + private boolean removeTriggers; protected BuildPublisherDescriptor() { super(BuildPublisher.class); @@ -128,7 +128,16 @@ public String getDisplayName() { return "Publish build"; } + + public void setRemoveTriggers(boolean removeTriggers) { + this.removeTriggers = removeTriggers; + } + + public boolean getRemoveTriggers() { + return removeTriggers; + } + @Override public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { //TODO post-actions @@ -150,6 +159,7 @@ String[] urls = req.getParameterValues("bp.url"); String[] logins = req.getParameterValues("bp.login"); String[] passwords = req.getParameterValues("bp.password"); + int len; if (names != null && urls != null) len = Math.min(names.length, urls.length); @@ -171,6 +181,8 @@ } this.publicInstances = servers; + + req.bindParameters(this, "bp.server."); save(); Index: src/main/java/hudson/plugins/build_publisher/ExternalProjectProperty.java =================================================================== --- src/main/java/hudson/plugins/build_publisher/ExternalProjectProperty.java (revision 32583) +++ src/main/java/hudson/plugins/build_publisher/ExternalProjectProperty.java (working copy) @@ -35,6 +35,8 @@ import java.util.logging.Level; import java.util.logging.Logger; +import hudson.triggers.TriggerDescriptor; + /** * Recieves builds submitted remotely via HTTP. * @@ -127,6 +129,11 @@ untar.setDest(buildsDir); untar.setOverwrite(true); + + if (BuildPublisher.DESCRIPTOR.getRemoveTriggers()) { + removeTriggers(project); + } + String publisherTimezoneID = (String)req.getHeader("X-Publisher-Timezone"); LOGGER.info("Got remote timezone " + publisherTimezoneID); TimeZone publisherTimezone = null; @@ -202,6 +209,14 @@ } } + private void removeTriggers(AbstractProject project) throws IOException { + for(TriggerDescriptor trigger: project.getTriggers().keySet()) { + project.removeTrigger(trigger); + } + + project.save(); + } + private void tidyUp() throws IOException, InterruptedException { // delete old builds Index: src/main/resources/hudson/plugins/build_publisher/BuildPublisher/global.jelly =================================================================== --- src/main/resources/hudson/plugins/build_publisher/BuildPublisher/global.jelly (revision 32583) +++ src/main/resources/hudson/plugins/build_publisher/BuildPublisher/global.jelly (working copy) @@ -31,7 +31,13 @@ - + + + + + + +