|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.triggers.Trigger<hudson.model.AbstractProject>
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger
public class GerritTrigger
Triggers a build based on Gerrit events.
Nested Class Summary | |
---|---|
static class |
GerritTrigger.DescriptorImpl
The Descriptor for the Trigger. |
static class |
GerritTrigger.RunningJobs
Class for maintaining and synchronizing the runningJobs info. |
Nested classes/interfaces inherited from class hudson.triggers.Trigger |
---|
hudson.triggers.Trigger.Cron |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary |
---|
Fields inherited from class hudson.triggers.Trigger |
---|
job, spec, tabs, timer |
Constructor Summary | |
---|---|
GerritTrigger(java.util.List<GerritProject> gerritProjects,
java.lang.Integer gerritBuildStartedVerifiedValue,
java.lang.Integer gerritBuildStartedCodeReviewValue,
java.lang.Integer gerritBuildSuccessfulVerifiedValue,
java.lang.Integer gerritBuildSuccessfulCodeReviewValue,
java.lang.Integer gerritBuildFailedVerifiedValue,
java.lang.Integer gerritBuildFailedCodeReviewValue,
java.lang.Integer gerritBuildUnstableVerifiedValue,
java.lang.Integer gerritBuildUnstableCodeReviewValue,
boolean silentMode,
boolean escapeQuotes,
java.lang.String buildStartMessage,
java.lang.String buildSuccessfulMessage,
java.lang.String buildUnstableMessage,
java.lang.String buildFailureMessage,
java.lang.String buildUnsuccessfulFilepath,
java.lang.String customUrl)
Default DataBound Constructor. |
Method Summary | |
---|---|
protected hudson.model.ParametersAction |
createParameters(PatchsetCreated event,
hudson.model.AbstractProject project)
Creates a ParameterAction and fills it with the project's default parameters + the Standard Gerrit parameters. |
void |
gerritEvent(ChangeAbandoned event)
Called when a ChangeAbandoned event arrives. |
void |
gerritEvent(GerritEvent event)
|
void |
gerritEvent(PatchsetCreated event)
Called when a PatchSetCreated event arrives. |
java.lang.String |
getBuildFailureMessage()
The message to show users when a build finishes, if custom messages are enabled. |
int |
getBuildScheduleDelay()
getBuildScheduleDelay method will return configured buildScheduledelay value. |
java.lang.String |
getBuildStartMessage()
The message to show users when a build starts, if custom messages are enabled. |
java.lang.String |
getBuildSuccessfulMessage()
The message to show users when a build succeeds, if custom messages are enabled. |
java.lang.String |
getBuildUnstableMessage()
The message to show users when a build is unstable, if custom messages are enabled. |
java.lang.String |
getBuildUnsuccessfulFilepath()
The path to a file that contains the unsuccessful Gerrit comment message. |
java.lang.String |
getCustomUrl()
URL to send in comment to gerrit. |
java.lang.Integer |
getGerritBuildFailedCodeReviewValue()
Job specific Gerrit code review vote when a build is failed, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildFailedVerifiedValue()
Job specific Gerrit verified vote when a build is failed, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildStartedCodeReviewValue()
Job specific Gerrit code review vote when a build is started, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildStartedVerifiedValue()
Job specific Gerrit verified vote when a build is started, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildSuccessfulCodeReviewValue()
Job specific Gerrit code review vote when a build is successful, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildSuccessfulVerifiedValue()
Job specific Gerrit verified vote when a build is successful, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildUnstableCodeReviewValue()
Job specific Gerrit code review vote when a build is unstable, null means that the global value should be used. |
java.lang.Integer |
getGerritBuildUnstableVerifiedValue()
Job specific Gerrit verified vote when a build is unstable, null means that the global value should be used. |
java.util.List<GerritProject> |
getGerritProjects()
The list of GerritProject triggering rules. |
static GerritTrigger |
getTrigger(hudson.model.AbstractProject project)
Finds the GerritTrigger in a project. |
int |
hashCode()
|
boolean |
isEscapeQuotes()
if escapeQuotes is on or off. |
boolean |
isFileTriggerEnabled()
Convenience method for finding it out if file triggering is enabled in the gerrit version. |
boolean |
isSilentMode()
If silent mode is on or off. |
void |
notifyBuildEnded(PatchsetCreated patchset)
Used to inform the plugin that the builds for a job have ended. |
void |
retriggerAllBuilds(TriggerContext context)
Retriggers all builds in the given context. |
void |
retriggerThisBuild(TriggerContext context)
Re-triggers the build in TriggerContext.getThisBuild() for the context's event. |
protected void |
schedule(GerritCause cause,
PatchsetCreated event)
Schedules a build with parameters from the event. |
protected void |
schedule(GerritCause cause,
PatchsetCreated event,
hudson.model.AbstractProject project)
Schedules a build with parameters from the event. |
void |
setBuildUnsuccessfulFilepath(java.lang.String path)
Sets the path to a file that contains the unsuccessful Gerrit comment message. |
void |
setCustomUrl(java.lang.String customUrl)
Set custom URL to post back to gerrit. |
void |
setEscapeQuotes(boolean escapeQuotes)
Sets escapeQuotes to on or off. |
void |
setGerritBuildFailedCodeReviewValue(java.lang.Integer gerritBuildFailedCodeReviewValue)
Job specific Gerrit code review vote when a build is failed, providing null means that the global value should be used. |
void |
setGerritBuildFailedVerifiedValue(java.lang.Integer gerritBuildFailedVerifiedValue)
Job specific Gerrit verified vote when a build is failed, providing null means that the global value should be used. |
void |
setGerritBuildStartedCodeReviewValue(java.lang.Integer gerritBuildStartedCodeReviewValue)
Job specific Gerrit code review vote when a build is started, providing null means that the global value should be used. |
void |
setGerritBuildStartedVerifiedValue(java.lang.Integer gerritBuildStartedVerifiedValue)
Job specific Gerrit verified vote when a build is started, providing null means that the global value should be used. |
void |
setGerritBuildSuccessfulCodeReviewValue(java.lang.Integer gerritBuildSuccessfulCodeReviewValue)
Job specific Gerrit code review vote when a build is successful, providing null means that the global value should be used. |
void |
setGerritBuildSuccessfulVerifiedValue(java.lang.Integer gerritBuildSuccessfulVerifiedValue)
Job specific Gerrit verified vote when a build is successful, providing null means that the global value should be used. |
void |
setGerritBuildUnstableCodeReviewValue(java.lang.Integer gerritBuildUnstableCodeReviewValue)
Job specific Gerrit code review vote when a build is unstable, providing null means that the global value should be used. |
void |
setGerritBuildUnstableVerifiedValue(java.lang.Integer gerritBuildUnstableVerifiedValue)
Job specific Gerrit verified vote when a build is unstable, providing null means that the global value should be used. |
void |
setGerritProjects(java.util.List<GerritProject> gerritProjects)
The list of GerritProject triggering rules. |
void |
setSilentMode(boolean silentMode)
Sets silent mode to on or off. |
void |
start(hudson.model.AbstractProject project,
boolean newInstance)
|
void |
stop()
|
Methods inherited from class hudson.triggers.Trigger |
---|
all, checkTriggers, for_, getDescriptor, getProjectAction, getProjectActions, getSpec, init, readResolve, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@DataBoundConstructor public GerritTrigger(java.util.List<GerritProject> gerritProjects, java.lang.Integer gerritBuildStartedVerifiedValue, java.lang.Integer gerritBuildStartedCodeReviewValue, java.lang.Integer gerritBuildSuccessfulVerifiedValue, java.lang.Integer gerritBuildSuccessfulCodeReviewValue, java.lang.Integer gerritBuildFailedVerifiedValue, java.lang.Integer gerritBuildFailedCodeReviewValue, java.lang.Integer gerritBuildUnstableVerifiedValue, java.lang.Integer gerritBuildUnstableCodeReviewValue, boolean silentMode, boolean escapeQuotes, java.lang.String buildStartMessage, java.lang.String buildSuccessfulMessage, java.lang.String buildUnstableMessage, java.lang.String buildFailureMessage, java.lang.String buildUnsuccessfulFilepath, java.lang.String customUrl)
gerritProjects
- the set of triggering rules.gerritBuildStartedVerifiedValue
- Job specific Gerrit verified vote when a build is started, null means that
the global value should be used.gerritBuildStartedCodeReviewValue
- Job specific Gerrit code review vote when a build is started, null means
that the global value should be used.gerritBuildSuccessfulVerifiedValue
- Job specific Gerrit verified vote when a build is successful, null means
that the global value should be used.gerritBuildSuccessfulCodeReviewValue
- Job specific Gerrit code review vote when a build is successful, null means
that the global value should be used.gerritBuildFailedVerifiedValue
- Job specific Gerrit verified vote when a build is failed, null means that
the global value should be used.gerritBuildFailedCodeReviewValue
- Job specific Gerrit code review vote when a build is failed, null means
that the global value should be used.gerritBuildUnstableVerifiedValue
- Job specific Gerrit verified vote when a build is unstable, null means that
the global value should be used.gerritBuildUnstableCodeReviewValue
- Job specific Gerrit code review vote when a build is unstable, null means
that the global value should be used.silentMode
- Silent Mode on or off.escapeQuotes
- EscapeQuotes on or off.buildStartMessage
- Message to write to Gerrit when a build beginsbuildSuccessfulMessage
- Message to write to Gerrit when a build succeedsbuildUnstableMessage
- Message to write to Gerrit when a build is unstablebuildFailureMessage
- Message to write to Gerrit when a build failsbuildUnsuccessfulFilepath
- Filename to retrieve Gerrit comment message from, in the case of an
unsuccessful build.customUrl
- Custom URL to sen to gerrit instead of build URLMethod Detail |
---|
public static GerritTrigger getTrigger(hudson.model.AbstractProject project)
project
- the project.
public void start(hudson.model.AbstractProject project, boolean newInstance)
start
in class hudson.triggers.Trigger<hudson.model.AbstractProject>
public void stop()
stop
in class hudson.triggers.Trigger<hudson.model.AbstractProject>
public void gerritEvent(GerritEvent event)
gerritEvent
in interface GerritEventListener
public void gerritEvent(PatchsetCreated event)
gerritEvent
in interface GerritEventListener
event
- the eventprotected void schedule(GerritCause cause, PatchsetCreated event)
myProject
as the project to build.
cause
- the cause of the build.event
- the event.protected void schedule(GerritCause cause, PatchsetCreated event, hudson.model.AbstractProject project)
cause
- the cause of the build.event
- the event.project
- the project to build.public void notifyBuildEnded(PatchsetCreated patchset)
patchset
- the patchset.public int getBuildScheduleDelay()
GerritDefaultValues.DEFAULT_BUILD_SCHEDULE_DELAY
.
protected hudson.model.ParametersAction createParameters(PatchsetCreated event, hudson.model.AbstractProject project)
event
- the event.project
- the project.
public void retriggerThisBuild(TriggerContext context)
TriggerContext.getThisBuild()
for the context's event. Will not do any isInteresting(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.PatchsetCreated)
checks. If more
than one build was triggered by the event the results from those builds will be counted again, but they won't be
re-triggered. If any builds for the event are still running, this new scheduled build will replace its
predesessor. If the project is currently building the event, no scheduling will be done.
context
- the previous context.public void retriggerAllBuilds(TriggerContext context)
context
- the context to rebuild.ToGerritRunListener.isBuilding(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.PatchsetCreated)
public int hashCode()
hashCode
in class java.lang.Object
public void gerritEvent(ChangeAbandoned event)
gerritEvent
in interface GerritEventListener
event
- the event.public java.util.List<GerritProject> getGerritProjects()
public void setGerritProjects(java.util.List<GerritProject> gerritProjects)
gerritProjects
- the rule-setpublic java.lang.Integer getGerritBuildFailedCodeReviewValue()
public void setGerritBuildFailedCodeReviewValue(java.lang.Integer gerritBuildFailedCodeReviewValue)
gerritBuildFailedCodeReviewValue
- the vote value.public java.lang.Integer getGerritBuildFailedVerifiedValue()
public void setGerritBuildFailedVerifiedValue(java.lang.Integer gerritBuildFailedVerifiedValue)
gerritBuildFailedVerifiedValue
- the vote value.public java.lang.Integer getGerritBuildStartedCodeReviewValue()
public void setGerritBuildStartedCodeReviewValue(java.lang.Integer gerritBuildStartedCodeReviewValue)
gerritBuildStartedCodeReviewValue
- the vote value.public java.lang.Integer getGerritBuildStartedVerifiedValue()
public void setGerritBuildStartedVerifiedValue(java.lang.Integer gerritBuildStartedVerifiedValue)
gerritBuildStartedVerifiedValue
- the vote value.public java.lang.Integer getGerritBuildSuccessfulCodeReviewValue()
public void setGerritBuildSuccessfulCodeReviewValue(java.lang.Integer gerritBuildSuccessfulCodeReviewValue)
gerritBuildSuccessfulCodeReviewValue
- the vote value.public java.lang.Integer getGerritBuildSuccessfulVerifiedValue()
public void setGerritBuildSuccessfulVerifiedValue(java.lang.Integer gerritBuildSuccessfulVerifiedValue)
gerritBuildSuccessfulVerifiedValue
- the vote value.public java.lang.Integer getGerritBuildUnstableCodeReviewValue()
public void setGerritBuildUnstableCodeReviewValue(java.lang.Integer gerritBuildUnstableCodeReviewValue)
gerritBuildUnstableCodeReviewValue
- the vote value.public java.lang.Integer getGerritBuildUnstableVerifiedValue()
public void setGerritBuildUnstableVerifiedValue(java.lang.Integer gerritBuildUnstableVerifiedValue)
gerritBuildUnstableVerifiedValue
- the vote value.public void setBuildUnsuccessfulFilepath(java.lang.String path)
path
- The unsuccessful message comment file pathpublic boolean isSilentMode()
public boolean isEscapeQuotes()
public void setEscapeQuotes(boolean escapeQuotes)
escapeQuotes
- is true if escapeQuotes should be on.public java.lang.String getBuildStartMessage()
public java.lang.String getBuildSuccessfulMessage()
public java.lang.String getBuildUnstableMessage()
public java.lang.String getBuildFailureMessage()
public java.lang.String getBuildUnsuccessfulFilepath()
public void setSilentMode(boolean silentMode)
silentMode
- true if silent mode should be on.public java.lang.String getCustomUrl()
public void setCustomUrl(java.lang.String customUrl)
customUrl
- url to setpublic boolean isFileTriggerEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |