Package hudson.triggers
Class SCMTrigger
- java.lang.Object
-
- hudson.triggers.Trigger<Item>
-
- hudson.triggers.SCMTrigger
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Trigger<?>>
public class SCMTrigger extends Trigger<Item>
Trigger
that checks for SCM updates periodically. You can add UI elements under the SCM section by creating a config.jelly or config.groovy in the resources area for your class that inherits from SCMTrigger and has theExtension
annotation. The UI should be wrapped in an f:section element to denote it.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SCMTrigger.AdministrativeMonitorImpl
static class
SCMTrigger.BuildAction
Associated withRun
to show the polling log that triggered that build.static class
SCMTrigger.DescriptorImpl
class
SCMTrigger.Runner
Runnable
that actually performs polling.class
SCMTrigger.SCMAction
Action object for job.static class
SCMTrigger.SCMTriggerCause
-
Nested classes/interfaces inherited from class hudson.triggers.Trigger
Trigger.Cron
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static long
STARVATION_THRESHOLD
How long is too long for a polling activity to be in the queue?
-
Constructor Summary
Constructors Constructor Description SCMTrigger(String scmpoll_spec)
SCMTrigger(String scmpoll_spec, boolean ignorePostCommitHooks)
Deprecated.since 2.21
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SCMTrigger.DescriptorImpl
getDescriptor()
Gets the descriptor for this instance.File
getLogFile()
Returns the file that records the last/current polling activity.Collection<? extends Action>
getProjectActions()
Action
s to be displayed in the job page.String
getScmpoll_spec()
boolean
isIgnorePostCommitHooks()
This trigger wants to ignore post-commit hooks.void
run()
Executes the triggered task.void
run(Action[] additionalActions)
Run the SCM trigger with additional build actions.void
setIgnorePostCommitHooks(boolean ignorePostCommitHooks)
Data-bound setter for ignoring post commit hooks.-
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getProjectAction, getSpec, readResolve, start, stop
-
-
-
-
Constructor Detail
-
SCMTrigger
@DataBoundConstructor public SCMTrigger(String scmpoll_spec)
-
SCMTrigger
@Deprecated public SCMTrigger(String scmpoll_spec, boolean ignorePostCommitHooks)
Deprecated.since 2.21Backwards-compatibility constructor.- Parameters:
scmpoll_spec
- The spec to poll with.ignorePostCommitHooks
- Whether to ignore post commit hooks.
-
-
Method Detail
-
isIgnorePostCommitHooks
public boolean isIgnorePostCommitHooks()
This trigger wants to ignore post-commit hooks.SCM plugins must respect this and not run this trigger for post-commit notifications.
- Since:
- 1.493
-
setIgnorePostCommitHooks
@DataBoundSetter public void setIgnorePostCommitHooks(boolean ignorePostCommitHooks)
Data-bound setter for ignoring post commit hooks.- Parameters:
ignorePostCommitHooks
- True if we should ignore post commit hooks, false otherwise.- Since:
- 2.22
-
getScmpoll_spec
public String getScmpoll_spec()
-
run
public void run()
Description copied from class:Trigger
Executes the triggered task. This method is invoked whenTrigger(String)
is used to create an instance, and the crontab matches the current time.Maybe run even before
Trigger.start(hudson.model.Item, boolean)
, prepare for it.
-
run
public void run(Action[] additionalActions)
Run the SCM trigger with additional build actions. Used by SubversionRepositoryStatus to trigger a build at a specific revision number.- Since:
- 1.375
-
getDescriptor
public SCMTrigger.DescriptorImpl getDescriptor()
Description copied from interface:Describable
Gets the descriptor for this instance.Descriptor
is a singleton for every concreteDescribable
implementation, so ifa.getClass() == b.getClass()
then by defaulta.getDescriptor() == b.getDescriptor()
as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptor
in interfaceDescribable<Trigger<?>>
- Overrides:
getDescriptor
in classTrigger<Item>
-
getProjectActions
public Collection<? extends Action> getProjectActions()
Description copied from class:Trigger
Action
s to be displayed in the job page.- Overrides:
getProjectActions
in classTrigger<Item>
- Returns:
- can be empty but never null
-
getLogFile
public File getLogFile()
Returns the file that records the last/current polling activity.
-
-