Class GitLabPushTrigger

java.lang.Object
hudson.triggers.Trigger<Job<?,?>>
com.dabsquared.gitlabjenkins.GitLabPushTrigger
All Implemented Interfaces:
MergeRequestTriggerConfig, ExtensionPoint, Describable<Trigger<?>>

public class GitLabPushTrigger extends Trigger<Job<?,?>> implements MergeRequestTriggerConfig
Triggers a build when we receive a GitLab WebHook.
Author:
Daniel Brooks
  • Constructor Details

    • GitLabPushTrigger

      @Deprecated public GitLabPushTrigger(boolean triggerOnPush, boolean triggerToBranchDeleteRequest, boolean triggerOnMergeRequest, boolean triggerOnlyIfNewCommitsPushed, boolean triggerOnAcceptedMergeRequest, boolean triggerOnClosedMergeRequest, TriggerOpenMergeRequest triggerOpenMergeRequestOnPush, boolean triggerOnNoteRequest, String noteRegex, boolean skipWorkInProgressMergeRequest, boolean ciSkip, String labelsThatForcesBuildIfAdded, boolean setBuildDescription, boolean addNoteOnMergeRequest, boolean addCiMessage, boolean addVoteOnMergeRequest, boolean acceptMergeRequestOnSuccess, BranchFilterType branchFilterType, String includeBranchesSpec, String excludeBranchesSpec, String sourceBranchRegex, String targetBranchRegex, MergeRequestLabelFilterConfig mergeRequestLabelFilterConfig, String secretToken, boolean triggerOnPipelineEvent, boolean triggerOnApprovedMergeRequest, String pendingBuildName, boolean cancelPendingBuildsOnUpdate)
      Deprecated.
      use GitLabPushTrigger() with setters to configure an instance of this class.
    • GitLabPushTrigger

      @DataBoundConstructor public GitLabPushTrigger()
  • Method Details

    • migrateJobs

      @Initializer(after=JOB_LOADED) public static void migrateJobs() throws IOException
      Throws:
      IOException
    • getTriggerOnPush

      public boolean getTriggerOnPush()
    • getTriggerToBranchDeleteRequest

      public boolean getTriggerToBranchDeleteRequest()
    • getTriggerOnMergeRequest

      public boolean getTriggerOnMergeRequest()
      Specified by:
      getTriggerOnMergeRequest in interface MergeRequestTriggerConfig
    • isTriggerOnlyIfNewCommitsPushed

      public boolean isTriggerOnlyIfNewCommitsPushed()
      Specified by:
      isTriggerOnlyIfNewCommitsPushed in interface MergeRequestTriggerConfig
    • isTriggerOnAcceptedMergeRequest

      public boolean isTriggerOnAcceptedMergeRequest()
      Specified by:
      isTriggerOnAcceptedMergeRequest in interface MergeRequestTriggerConfig
    • isTriggerOnApprovedMergeRequest

      public boolean isTriggerOnApprovedMergeRequest()
      Specified by:
      isTriggerOnApprovedMergeRequest in interface MergeRequestTriggerConfig
    • isTriggerOnClosedMergeRequest

      public boolean isTriggerOnClosedMergeRequest()
      Specified by:
      isTriggerOnClosedMergeRequest in interface MergeRequestTriggerConfig
    • getTriggerOnNoteRequest

      public boolean getTriggerOnNoteRequest()
    • getTriggerOnPipelineEvent

      public boolean getTriggerOnPipelineEvent()
    • getNoteRegex

      public String getNoteRegex()
    • getTriggerOpenMergeRequestOnPush

      public TriggerOpenMergeRequest getTriggerOpenMergeRequestOnPush()
      Specified by:
      getTriggerOpenMergeRequestOnPush in interface MergeRequestTriggerConfig
    • getSetBuildDescription

      public boolean getSetBuildDescription()
    • getCiSkip

      public boolean getCiSkip()
    • isSkipWorkInProgressMergeRequest

      public boolean isSkipWorkInProgressMergeRequest()
      Specified by:
      isSkipWorkInProgressMergeRequest in interface MergeRequestTriggerConfig
    • getLabelsThatForcesBuildIfAdded

      public String getLabelsThatForcesBuildIfAdded()
      Specified by:
      getLabelsThatForcesBuildIfAdded in interface MergeRequestTriggerConfig
    • getBranchFilterType

      public BranchFilterType getBranchFilterType()
    • getIncludeBranchesSpec

      public String getIncludeBranchesSpec()
    • getExcludeBranchesSpec

      public String getExcludeBranchesSpec()
    • getSourceBranchRegex

      public String getSourceBranchRegex()
    • getTargetBranchRegex

      public String getTargetBranchRegex()
    • getMergeRequestLabelFilterConfig

      public MergeRequestLabelFilterConfig getMergeRequestLabelFilterConfig()
    • getSecretToken

      public String getSecretToken()
    • getPendingBuildName

      public String getPendingBuildName()
    • getCancelPendingBuildsOnUpdate

      public boolean getCancelPendingBuildsOnUpdate()
      Specified by:
      getCancelPendingBuildsOnUpdate in interface MergeRequestTriggerConfig
    • setTriggerOnPush

      @DataBoundSetter public void setTriggerOnPush(boolean triggerOnPush)
    • setTriggerToBranchDeleteRequest

      @DataBoundSetter public void setTriggerToBranchDeleteRequest(boolean triggerToBranchDeleteRequest)
    • setTriggerOnApprovedMergeRequest

      @DataBoundSetter public void setTriggerOnApprovedMergeRequest(boolean triggerOnApprovedMergeRequest)
    • setTriggerOnMergeRequest

      @DataBoundSetter public void setTriggerOnMergeRequest(boolean triggerOnMergeRequest)
    • setTriggerOnlyIfNewCommitsPushed

      @DataBoundSetter public void setTriggerOnlyIfNewCommitsPushed(boolean triggerOnlyIfNewCommitsPushed)
    • setTriggerOnAcceptedMergeRequest

      @DataBoundSetter public void setTriggerOnAcceptedMergeRequest(boolean triggerOnAcceptedMergeRequest)
    • setTriggerOnClosedMergeRequest

      @DataBoundSetter public void setTriggerOnClosedMergeRequest(boolean triggerOnClosedMergeRequest)
    • setTriggerOpenMergeRequestOnPush

      @DataBoundSetter public void setTriggerOpenMergeRequestOnPush(TriggerOpenMergeRequest triggerOpenMergeRequestOnPush)
    • setTriggerOnNoteRequest

      @DataBoundSetter public void setTriggerOnNoteRequest(boolean triggerOnNoteRequest)
    • setNoteRegex

      @DataBoundSetter public void setNoteRegex(String noteRegex)
    • setCiSkip

      @DataBoundSetter public void setCiSkip(boolean ciSkip)
    • setSkipWorkInProgressMergeRequest

      @DataBoundSetter public void setSkipWorkInProgressMergeRequest(boolean skipWorkInProgressMergeRequest)
    • setLabelsThatForcesBuildIfAdded

      @DataBoundSetter public void setLabelsThatForcesBuildIfAdded(String labelsThatForcesBuildIfAdded)
    • setSetBuildDescription

      @DataBoundSetter public void setSetBuildDescription(boolean setBuildDescription)
    • setAddNoteOnMergeRequest

      @DataBoundSetter public void setAddNoteOnMergeRequest(boolean addNoteOnMergeRequest)
    • setAddCiMessage

      @DataBoundSetter public void setAddCiMessage(boolean addCiMessage)
    • setAddVoteOnMergeRequest

      @DataBoundSetter public void setAddVoteOnMergeRequest(boolean addVoteOnMergeRequest)
    • setBranchFilterName

      @DataBoundSetter public void setBranchFilterName(String branchFilterName)
    • setBranchFilterType

      @DataBoundSetter public void setBranchFilterType(BranchFilterType branchFilterType)
    • setIncludeBranchesSpec

      @DataBoundSetter public void setIncludeBranchesSpec(String includeBranchesSpec)
    • setExcludeBranchesSpec

      @DataBoundSetter public void setExcludeBranchesSpec(String excludeBranchesSpec)
    • setSourceBranchRegex

      @DataBoundSetter public void setSourceBranchRegex(String sourceBranchRegex)
    • setTargetBranchRegex

      @DataBoundSetter public void setTargetBranchRegex(String targetBranchRegex)
    • setMergeRequestLabelFilterConfig

      @DataBoundSetter public void setMergeRequestLabelFilterConfig(MergeRequestLabelFilterConfig mergeRequestLabelFilterConfig)
    • setSecretToken

      @DataBoundSetter public void setSecretToken(String secretToken)
    • setAcceptMergeRequestOnSuccess

      @DataBoundSetter public void setAcceptMergeRequestOnSuccess(boolean acceptMergeRequestOnSuccess)
    • getAcceptMergeRequestOnSuccess

      public boolean getAcceptMergeRequestOnSuccess()
    • getAddCiMessage

      public boolean getAddCiMessage()
    • getAddNoteOnMergeRequest

      public boolean getAddNoteOnMergeRequest()
    • getAddVoteOnMergeRequest

      public boolean getAddVoteOnMergeRequest()
    • getSkipWorkInProgressMergeRequest

      public boolean getSkipWorkInProgressMergeRequest()
    • getBranchFilterName

      public String getBranchFilterName()
    • setTriggerOnPipelineEvent

      @DataBoundSetter public void setTriggerOnPipelineEvent(boolean triggerOnPipelineEvent)
    • setPendingBuildName

      @DataBoundSetter public void setPendingBuildName(String pendingBuildName)
    • setCancelPendingBuildsOnUpdate

      @DataBoundSetter public void setCancelPendingBuildsOnUpdate(boolean cancelPendingBuildsOnUpdate)
    • onPost

      public void onPost(PushHook hook)
    • onPost

      public void onPost(MergeRequestHook hook)
    • onPost

      public void onPost(NoteHook hook)
    • onPost

      public void onPost(PipelineHook hook)
    • readResolve

      protected Object readResolve() throws ObjectStreamException
      Overrides:
      readResolve in class Trigger<Job<?,?>>
      Throws:
      ObjectStreamException
    • getFromJob

      public static GitLabPushTrigger getFromJob(Job<?,?> job)