public abstract class AbstractSCMBridge extends Object implements hudson.model.Describable<AbstractSCMBridge>, hudson.ExtensionPoint
Modifier and Type | Field and Description |
---|---|
IntegrationStrategy |
integrationStrategy
The integration strategy.
|
protected static String |
LOG_PREFIX |
Constructor and Description |
---|
AbstractSCMBridge(IntegrationStrategy integrationStrategy)
Constructor for the SCM bridge.
|
Modifier and Type | Method and Description |
---|---|
static hudson.DescriptorExtensionList<AbstractSCMBridge,SCMBridgeDescriptor<AbstractSCMBridge>> |
all() |
void |
deleteIntegratedBranch(hudson.model.AbstractBuild<?,?> build,
hudson.model.TaskListener listener)
Deletes the integrated integrationBranch.
|
abstract void |
ensureBranch(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener,
String branch)
Make sure the SCM is checked out on the given integrationBranch.
|
static List<IntegrationStrategyDescriptor<?>> |
getBehaviours() |
hudson.model.Descriptor<AbstractSCMBridge> |
getDescriptor() |
static List<SCMBridgeDescriptor<?>> |
getDescriptors() |
String |
getExpandedIntegrationBranch(hudson.EnvVars environment) |
protected abstract String |
getIntegrationBranch()
Information about the result of the integration (Unknown, Conflict, Build, Push).
|
static hudson.model.Result |
getRequiredResult() |
void |
handleIntegrationExceptions(hudson.model.Run run,
hudson.model.TaskListener listener,
Exception e) |
abstract void |
handlePostBuild(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Called after the build has run.
|
void |
isApplicable(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Determines if we should prepare a workspace for integration.
|
protected void |
mergeChanges(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Integrates the commit into the integration integrationBranch.
|
void |
prepareWorkspace(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Called after the SCM plugin has updated the workspace with remote changes.
|
void |
pushToIntegrationBranch(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Pushes changes to the integration integrationBranch.
|
void |
updateBuildDescription(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Updates the description of the Jenkins build.
|
void |
validateConfiguration(hudson.model.AbstractProject<?,?> project)
Validates the configuration of the Jenkins Job.
|
public final IntegrationStrategy integrationStrategy
protected static final String LOG_PREFIX
public AbstractSCMBridge(IntegrationStrategy integrationStrategy)
integrationStrategy
- The integration strategy to apply when merging commits.protected abstract String getIntegrationBranch()
public void handleIntegrationExceptions(hudson.model.Run run, hudson.model.TaskListener listener, Exception e) throws IOException, InterruptedException
IOException
InterruptedException
public void pushToIntegrationBranch(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener) throws PushFailedException
build
- The Buildlistener
- The BuildListenerPushFailedException
- Used in case of not being able to pushpublic void deleteIntegratedBranch(hudson.model.AbstractBuild<?,?> build, hudson.model.TaskListener listener) throws BranchDeletionFailedException, IOException, InterruptedException
build
- The Abstractbuildlistener
- The BuildListenerBranchDeletionFailedException
- Used in case remote branch deletion failsInterruptedException
- An foreseen issueIOException
public abstract void ensureBranch(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener, String branch) throws EstablishingWorkspaceFailedException
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerbranch
- The integrationBranch to check outEstablishingWorkspaceFailedException
- Used in case the branch cannot be checked outpublic abstract void handlePostBuild(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws IOException
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerIOException
- A repository could not be reached.public void isApplicable(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener) throws NothingToDoException, UnsupportedConfigurationException, IOException, InterruptedException
build
- The Buildlistener
- The BuildListenerNothingToDoException
- Used in no git SCM data foundUnsupportedConfigurationException
- Used in case of ambiguous git data of the remote repoInterruptedException
- An unforeseen issueIOException
protected void mergeChanges(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws NothingToDoException, IntegrationFailedException, IntegrationUnknownFailureException, UnsupportedConfigurationException
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerNothingToDoException
- Used in case the submitted commit is behind the integrationIntegrationFailedException
- Used in case the merge/integration fails or cannot count commitsUnsupportedConfigurationException
- UnsupportedConfigurationExceptionIntegrationUnknownFailureException
- An unforeseen issuepublic void prepareWorkspace(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws EstablishingWorkspaceFailedException, NothingToDoException, IntegrationFailedException, IntegrationUnknownFailureException, UnsupportedConfigurationException
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerIntegrationFailedException
- Used in case the merge/integration fails or cannot count commitsEstablishingWorkspaceFailedException
- EstablishingWorkspaceFailedExceptionNothingToDoException
- Used in case the submitted commit is behind the integrationIntegrationUnknownFailureException
- An unforeseen issueUnsupportedConfigurationException
- Mismatch in job configurationpublic void updateBuildDescription(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws NothingToDoException, UnsupportedConfigurationException, IOException, InterruptedException
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerNothingToDoException
- Used in case the submitted commit is behind the integrationUnsupportedConfigurationException
- Mismatch in job configurationInterruptedException
- An unforeseen issueIOException
public void validateConfiguration(hudson.model.AbstractProject<?,?> project) throws UnsupportedConfigurationException
project
- The ProjectUnsupportedConfigurationException
- Mismatch in job configurationpublic static hudson.DescriptorExtensionList<AbstractSCMBridge,SCMBridgeDescriptor<AbstractSCMBridge>> all()
public static List<IntegrationStrategyDescriptor<?>> getBehaviours()
public hudson.model.Descriptor<AbstractSCMBridge> getDescriptor()
getDescriptor
in interface hudson.model.Describable<AbstractSCMBridge>
public static List<SCMBridgeDescriptor<?>> getDescriptors()
public String getExpandedIntegrationBranch(hudson.EnvVars environment)
environment
- environmentpublic static hudson.model.Result getRequiredResult()
Copyright © 2016–2018. All rights reserved.