Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FIXED JENKINS-10990] Send email for NOT_BUILT and ABORTED builds.
- Loading branch information
Showing
6 changed files
with
205 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/hudson/plugins/emailext/plugins/trigger/AbortedTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package hudson.plugins.emailext.plugins.trigger; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.Result; | ||
import hudson.plugins.emailext.plugins.EmailTrigger; | ||
import hudson.plugins.emailext.plugins.EmailTriggerDescriptor; | ||
|
||
public class AbortedTrigger extends EmailTrigger { | ||
|
||
public static final String TRIGGER_NAME = "Aborted"; | ||
|
||
public AbortedTrigger() { | ||
} | ||
|
||
@Override | ||
public boolean trigger(AbstractBuild<?, ?> build) { | ||
Result buildResult = build.getResult(); | ||
|
||
if (buildResult == Result.ABORTED) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public EmailTriggerDescriptor getDescriptor() { | ||
return DESCRIPTOR; | ||
} | ||
|
||
public static DescriptorImpl DESCRIPTOR = new DescriptorImpl(); | ||
|
||
public static final class DescriptorImpl extends EmailTriggerDescriptor { | ||
|
||
@Override | ||
public String getTriggerName() { | ||
return TRIGGER_NAME; | ||
} | ||
|
||
@Override | ||
public EmailTrigger newInstance() { | ||
return new AbortedTrigger(); | ||
} | ||
|
||
@Override | ||
public String getHelpText() { | ||
return Messages.AbortedTrigger_HelpText(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean getDefaultSendToDevs() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean getDefaultSendToList() { | ||
return true; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/main/java/hudson/plugins/emailext/plugins/trigger/NotBuiltTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package hudson.plugins.emailext.plugins.trigger; | ||
|
||
import hudson.model.AbstractBuild; | ||
import hudson.model.Result; | ||
import hudson.plugins.emailext.plugins.EmailTrigger; | ||
import hudson.plugins.emailext.plugins.EmailTriggerDescriptor; | ||
|
||
public class NotBuiltTrigger extends EmailTrigger { | ||
|
||
public static final String TRIGGER_NAME = "Not Built"; | ||
|
||
public NotBuiltTrigger() { | ||
} | ||
|
||
@Override | ||
public boolean trigger(AbstractBuild<?, ?> build) { | ||
Result buildResult = build.getResult(); | ||
|
||
if (buildResult == Result.NOT_BUILT) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public EmailTriggerDescriptor getDescriptor() { | ||
return DESCRIPTOR; | ||
} | ||
|
||
public static DescriptorImpl DESCRIPTOR = new DescriptorImpl(); | ||
|
||
public static final class DescriptorImpl extends EmailTriggerDescriptor { | ||
|
||
@Override | ||
public String getTriggerName() { | ||
return TRIGGER_NAME; | ||
} | ||
|
||
@Override | ||
public EmailTrigger newInstance() { | ||
return new NotBuiltTrigger(); | ||
} | ||
|
||
@Override | ||
public String getHelpText() { | ||
return Messages.NotBuiltTrigger_HelpText(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean getDefaultSendToDevs() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean getDefaultSendToList() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters