public abstract class GitSCMExtension extends hudson.model.AbstractDescribableImpl<GitSCMExtension>
GitSCM.| Constructor and Description |
|---|
GitSCMExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeCheckout(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener)
Called before the checkout activity (including fetch and checkout) starts.
|
org.jenkinsci.plugins.gitclient.GitClient |
decorate(GitSCM scm,
org.jenkinsci.plugins.gitclient.GitClient git)
Called when
GitClient is created to decorate its behaviour. |
void |
decorateCloneCommand(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener,
org.jenkinsci.plugins.gitclient.CloneCommand cmd)
Called before a
CloneCommand is executed to allow extensions to alter its behaviour. |
void |
decorateMergeCommand(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener,
org.jenkinsci.plugins.gitclient.MergeCommand cmd)
Called before a
MergeCommand is executed to allow extensions to alter its behaviour. |
hudson.plugins.git.Revision |
decorateRevisionToBuild(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener,
hudson.plugins.git.Revision rev)
Called after
BuildChooser selects the revision to pick for this build, but before
This allows extensions to select a derived revision (for example by merging another branch into
the chosen revision and returning it) or manipulate the state of the working tree (such as
running git-clean.) |
GitSCMExtensionDescriptor |
getDescriptor() |
GitClientType |
getRequiredClient()
Let extension declare required GitClient implementation. git-plugin will then detect conflicts, and fallback to
globally configured default git client
|
hudson.FilePath |
getWorkingDirectory(GitSCM scm,
hudson.model.AbstractProject<?,?> context,
hudson.FilePath workspace,
hudson.EnvVars environment,
hudson.model.TaskListener listener)
Given the workspace root directory, gets the working directory, which is where the repository will be checked out.
|
Boolean |
isRevExcluded(GitSCM scm,
org.jenkinsci.plugins.gitclient.GitClient git,
GitChangeSet commit,
hudson.model.TaskListener listener,
BuildData buildData)
Given a commit found during polling, check whether it should be disregarded.
|
void |
onCheckoutCompleted(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener)
Called when the checkout was completed and the working directory is filled with files.
|
void |
onClean(GitSCM scm,
org.jenkinsci.plugins.gitclient.GitClient git)
Signals when "git-clean" runs.
|
void |
populateEnvironmentVariables(GitSCM scm,
Map<String,String> env)
Contribute additional environment variables for the Git invocation.
|
public Boolean isRevExcluded(GitSCM scm, org.jenkinsci.plugins.gitclient.GitClient git, GitChangeSet commit, hudson.model.TaskListener listener, BuildData buildData) throws IOException, InterruptedException, hudson.plugins.git.GitException
scm - git - GitClient objectcommit - The commit whose exclusion is being tested.listener - GitSCMExtensions say.
false to trigger a build from this commit, regardless of what later GitSCMExtensions say.
null to allow other GitSCMExtensions to decide.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic hudson.FilePath getWorkingDirectory(GitSCM scm, hudson.model.AbstractProject<?,?> context, hudson.FilePath workspace, hudson.EnvVars environment, hudson.model.TaskListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
GitSCMExtension control it.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic hudson.plugins.git.Revision decorateRevisionToBuild(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener, hudson.plugins.git.Revision rev) throws IOException, InterruptedException, hudson.plugins.git.GitException
BuildChooser selects the revision to pick for this build, but before
This allows extensions to select a derived revision (for example by merging another branch into the chosen revision and returning it) or manipulate the state of the working tree (such as running git-clean.)
decorateRevisionToBuild(GitSCM, AbstractBuild, GitClient, BuildListener, Revision) vs BuildChooser
BuildChooser and this method are similar in the sense that they both participate in the process
of determining what commits to build. So when a plugin wants to control the commit to be built, you have
a choice of these two approaches. The rule of the thumb is to ask yourself if your process takes
another commit as an input.
BuildChooser is suitable when you do not take any commit as a parameter, and need to precisely
control what commit to build. For example the gerrit-trigger plugin looks at
a specific build parameter, then retrieves that commit from Gerrit and builds that.
decorateRevisionToBuild(GitSCM, AbstractBuild, GitClient, BuildListener, Revision) is suitable
when you accept arbitrary revision as an input and then create some derivative commits and then build that
result. The primary example is for speculative merge with another branch (people use this to answer
the question of "what happens if I were to integrate this feature branch back to the master branch?")
rev - The revision selected for this build.rev, return the value
given in the rev parameter.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void beforeCheckout(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void onCheckoutCompleted(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
SCM.checkout(AbstractBuild, Launcher, FilePath, BuildListener, File) for the available parameters,
except workingDirectory
Do not move the HEAD to another commit, as by this point the commit to be built is already determined
and recorded (such as changelog.)IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void onClean(GitSCM scm, org.jenkinsci.plugins.gitclient.GitClient git) throws IOException, InterruptedException, hudson.plugins.git.GitException
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic org.jenkinsci.plugins.gitclient.GitClient decorate(GitSCM scm, org.jenkinsci.plugins.gitclient.GitClient git) throws IOException, InterruptedException, hudson.plugins.git.GitException
GitClient is created to decorate its behaviour.
This allows extensions to customize the behaviour of GitClient.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void decorateCloneCommand(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener, org.jenkinsci.plugins.gitclient.CloneCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
CloneCommand is executed to allow extensions to alter its behaviour.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void decorateMergeCommand(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener, org.jenkinsci.plugins.gitclient.MergeCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
MergeCommand is executed to allow extensions to alter its behaviour.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void populateEnvironmentVariables(GitSCM scm, Map<String,String> env)
public GitClientType getRequiredClient()
public GitSCMExtensionDescriptor getDescriptor()
getDescriptor in interface hudson.model.Describable<GitSCMExtension>getDescriptor in class hudson.model.AbstractDescribableImpl<GitSCMExtension>Copyright © 2004-2013. All Rights Reserved.