public class GitBridge extends AbstractSCMBridge
Modifier and Type | Class and Description |
---|---|
static class |
GitBridge.DescriptorImpl
Descriptor implementation for GitBridge
|
branch, integrationStrategy
Constructor and Description |
---|
GitBridge(IntegrationStrategy integrationStrategy,
String branch,
String repositoryName)
Constructor for GitBridge.
|
Modifier and Type | Method and Description |
---|---|
void |
commit(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Pushes changes to the integration branch.
|
int |
countCommits(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Counts the commits in the relevant BuildData
|
void |
deleteIntegratedBranch(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Deletes the integrated branch.
|
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 branch.
|
hudson.plugins.git.util.BuildData |
findRelevantBuildData(hudson.model.AbstractBuild<?,?> build,
hudson.model.TaskListener listener)
Retrieves the BuildData for the given build relevant to the Integration Repository.
|
protected hudson.plugins.git.GitSCM |
findScm(hudson.model.AbstractBuild<?,?> build,
hudson.model.TaskListener listener)
Returns the Git SCM for the relevant build data.
|
String |
getBranch() |
String |
getExpandedBranch(hudson.EnvVars environment) |
String |
getRepoName() |
hudson.FilePath |
getWorkingDirectory() |
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.
|
hudson.FilePath |
resolveWorkspace(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Returns the workspace
|
void |
setRepoName(String repositoryName) |
void |
setWorkingDirectory(hudson.FilePath workingDirectory) |
protected void |
update(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Pulls in the remote branch
|
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.
|
all, getBehaviours, getDescriptor, getDescriptors, getRequiredResult, mergeChanges, prepareWorkspace
@DataBoundConstructor public GitBridge(IntegrationStrategy integrationStrategy, String branch, String repositoryName)
integrationStrategy
- The selected IntegrationStrategybranch
- The Integration Branch namerepositoryName
- The Integration Repository nameprotected hudson.plugins.git.GitSCM findScm(hudson.model.AbstractBuild<?,?> build, hudson.model.TaskListener listener) throws InterruptedException, NothingToDoException, UnsupportedConfigurationException
build
- The Buildlistener
- The BuildListenerInterruptedException
- When no matching SCMs are foundNothingToDoException
- When no relevant BuildData is found.UnsupportedConfigurationException
- When multiple, ambiguous relevant BuildDatas are found.public void ensureBranch(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener, String branch) throws EstablishingWorkspaceFailedException
ensureBranch
in class AbstractSCMBridge
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerbranch
- The branch to check outEstablishingWorkspaceFailedException
protected void update(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws IOException, InterruptedException
build
- The Buildlauncher
- The Launcherlistener
- The ListenerIOException
InterruptedException
public void commit(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws CommitFailedException
commit
in class AbstractSCMBridge
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerCommitFailedException
public hudson.plugins.git.util.BuildData findRelevantBuildData(hudson.model.AbstractBuild<?,?> build, hudson.model.TaskListener listener) throws NothingToDoException, UnsupportedConfigurationException
build
- The Buildlistener
- The TaskListenerNothingToDoException
- If no relevant BuildData was found.UnsupportedConfigurationException
- If multiple, ambiguous BuildDatas were found.public void isApplicable(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener) throws NothingToDoException, UnsupportedConfigurationException
isApplicable
in class AbstractSCMBridge
build
- The Buildlistener
- The BuildListenerNothingToDoException
UnsupportedConfigurationException
public void deleteIntegratedBranch(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws BranchDeletionFailedException, NothingToDoException, UnsupportedConfigurationException
deleteIntegratedBranch
in class AbstractSCMBridge
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerBranchDeletionFailedException
NothingToDoException
UnsupportedConfigurationException
public void updateBuildDescription(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws NothingToDoException, UnsupportedConfigurationException
updateBuildDescription
in class AbstractSCMBridge
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerNothingToDoException
UnsupportedConfigurationException
public hudson.FilePath resolveWorkspace(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener) throws InterruptedException, IOException
build
- The Buildlistener
- The ListenerInterruptedException
IOException
public void validateConfiguration(hudson.model.AbstractProject<?,?> project) throws UnsupportedConfigurationException
validateConfiguration
in class AbstractSCMBridge
project
- The ProjectUnsupportedConfigurationException
public int countCommits(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener) throws IOException, InterruptedException
build
- The Buildlistener
- The ListenerIOException
InterruptedException
public void handlePostBuild(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener) throws IOException
handlePostBuild
in class AbstractSCMBridge
build
- The Buildlauncher
- The Launcherlistener
- The BuildListenerIOException
- A repository could not be reached.public String getBranch()
getBranch
in class AbstractSCMBridge
public String getExpandedBranch(hudson.EnvVars environment)
getExpandedBranch
in class AbstractSCMBridge
environment
- The environment to expand the branch inpublic void setWorkingDirectory(hudson.FilePath workingDirectory)
workingDirectory
- the workingDirectory to setpublic hudson.FilePath getWorkingDirectory()
public String getRepoName()
public void setRepoName(String repositoryName)
repositoryName
- the repositoryName to setCopyright © 2004–2016. All rights reserved.