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)
Deprecated.
|
void |
beforeCheckout(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener 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 |
decorateCheckoutCommand(GitSCM scm,
hudson.model.AbstractBuild<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.BuildListener listener,
org.jenkinsci.plugins.gitclient.CheckoutCommand cmd)
Deprecated.
|
void |
decorateCheckoutCommand(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener listener,
org.jenkinsci.plugins.gitclient.CheckoutCommand cmd)
Called before a
CheckoutCommand is executed to allow extensions to alter 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)
Deprecated.
|
void |
decorateCloneCommand(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener listener,
org.jenkinsci.plugins.gitclient.CloneCommand cmd)
Called before a
CloneCommand is executed to allow extensions to alter its behaviour. |
void |
decorateFetchCommand(GitSCM scm,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener listener,
org.jenkinsci.plugins.gitclient.FetchCommand cmd)
Called before a
FetchCommand 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)
Deprecated.
|
void |
decorateMergeCommand(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener 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 marked,
hudson.plugins.git.Revision rev)
Deprecated.
|
hudson.plugins.git.Revision |
decorateRevisionToBuild(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener listener,
hudson.plugins.git.Revision marked,
hudson.plugins.git.Revision rev)
Called after
BuildChooser selects the revision to pick for this build, but before |
GitSCMExtensionDescriptor |
getDescriptor() |
GitClientType |
getRequiredClient()
Let extension declare required GitClient implementation.
|
hudson.FilePath |
getWorkingDirectory(GitSCM scm,
hudson.model.AbstractProject<?,?> context,
hudson.FilePath workspace,
hudson.EnvVars environment,
hudson.model.TaskListener listener)
Deprecated.
|
hudson.FilePath |
getWorkingDirectory(GitSCM scm,
hudson.model.Job<?,?> 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)
Deprecated.
|
void |
onCheckoutCompleted(GitSCM scm,
hudson.model.Run<?,?> build,
org.jenkinsci.plugins.gitclient.GitClient git,
hudson.model.TaskListener 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.
|
boolean |
requiresWorkspaceForPolling() |
public boolean requiresWorkspaceForPolling()
true when this extension has a requirement to get a workspace during polling,
typically as it has to check for incoming changes, not just remote HEAD.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.Job<?,?> context, hudson.FilePath workspace, hudson.EnvVars environment, hudson.model.TaskListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
GitSCMExtension control it.IOExceptionInterruptedExceptionhudson.plugins.git.GitException@Deprecated public 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
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic hudson.plugins.git.Revision decorateRevisionToBuild(GitSCM scm, hudson.model.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener listener, hudson.plugins.git.Revision marked, 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, Run, GitClient, TaskListener, Revision, 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, Run, GitClient, TaskListener, Revision, 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?")
marked - The revision that started this build. (e.g. pre-merge)rev - The revision selected for this build.rev, return the value
given in the rev parameter.IOExceptionInterruptedExceptionhudson.plugins.git.GitException@Deprecated public 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 marked, hudson.plugins.git.Revision rev) throws IOException, InterruptedException, hudson.plugins.git.GitException
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void beforeCheckout(GitSCM scm, hudson.model.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
IOExceptionInterruptedExceptionhudson.plugins.git.GitException@Deprecated public 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.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener listener) throws IOException, InterruptedException, hudson.plugins.git.GitException
SCM.checkout(Run, Launcher, FilePath, TaskListener, File, SCMRevisionState) 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.GitException@Deprecated public 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
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.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener 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.GitException@Deprecated public 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
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void decorateFetchCommand(GitSCM scm, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener listener, org.jenkinsci.plugins.gitclient.FetchCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
FetchCommand is executed to allow extensions to alter its behaviour.IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void decorateMergeCommand(GitSCM scm, hudson.model.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener 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.GitException@Deprecated public 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
IOExceptionInterruptedExceptionhudson.plugins.git.GitExceptionpublic void decorateCheckoutCommand(GitSCM scm, hudson.model.Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.TaskListener listener, org.jenkinsci.plugins.gitclient.CheckoutCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
CheckoutCommand is executed to allow extensions to alter its behaviour.IOExceptionInterruptedExceptionhudson.plugins.git.GitException@Deprecated public void decorateCheckoutCommand(GitSCM scm, hudson.model.AbstractBuild<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, hudson.model.BuildListener listener, org.jenkinsci.plugins.gitclient.CheckoutCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
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-2015. All Rights Reserved.