public class StashNotifier
extends hudson.tasks.Notifier
implements jenkins.tasks.SimpleBuildStep
Only basic authentication is supported at the moment.
| Modifier and Type | Class and Description |
|---|---|
static class |
StashNotifier.DescriptorImpl |
hudson.tasks.Publisher.DescriptorExtensionListImpljenkins.tasks.SimpleBuildStep.LastBuildAction, jenkins.tasks.SimpleBuildStep.LastBuildActionFactory| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_FIELD_LENGTH |
static int |
MAX_URL_FIELD_LENGTH |
| Constructor and Description |
|---|
StashNotifier(String stashServerBaseUrl,
String credentialsId,
boolean ignoreUnverifiedSSLPeer,
String commitSha1,
String buildStatus,
String buildName,
boolean includeBuildNumberInKey,
String projectKey,
boolean prependParentProjectKey,
boolean disableInprogressNotification,
boolean considerUnstableAsSuccess) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.client.methods.HttpPost |
createRequest(org.apache.http.HttpEntity stashBuildNotificationEntity,
hudson.model.Item project,
String commitSha1,
String url)
Deprecated.
in favor of method overload
|
protected String |
getBuildDescription(hudson.model.Run<?,?> run,
StashBuildState state)
Returns the description of the run used for the Bitbucket notification.
|
protected String |
getBuildKey(hudson.model.Run<?,?> run,
hudson.model.TaskListener listener)
Returns the run key used in the Bitbucket notification.
|
String |
getBuildName() |
protected String |
getBuildName(hudson.model.Run<?,?> run)
Returns the build name to be pushed.
|
StashBuildState |
getBuildStatus() |
String |
getCommitSha1() |
String |
getCredentialsId() |
StashNotifier.DescriptorImpl |
getDescriptor() |
protected org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(PrintStream logger,
hudson.model.Run<?,?> run,
String stashServer)
Deprecated.
|
boolean |
getIgnoreUnverifiedSSLPeer() |
boolean |
getIncludeBuildNumberInKey() |
boolean |
getPrependParentProjectKey() |
String |
getProjectKey() |
protected StashBuildState |
getPushedBuildStatus(StashBuildState currentBuildStatus)
Returns the build state to be pushed.
|
hudson.tasks.BuildStepMonitor |
getRequiredMonitorService() |
String |
getStashServerBaseUrl() |
boolean |
isConsiderUnstableAsSuccess() |
boolean |
isDisableInprogressNotification() |
protected Collection<String> |
lookupCommitSha1s(hudson.model.Run run,
hudson.FilePath workspace,
hudson.model.TaskListener listener) |
protected NotificationResult |
notifyStash(PrintStream logger,
hudson.model.Run<?,?> run,
String commitSha1,
hudson.model.TaskListener listener,
StashBuildState state)
Notifies the configured Bitbucket server by POSTing the run results
to the Bitbucket run API.
|
boolean |
perform(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener) |
void |
perform(hudson.model.Run<?,?> run,
hudson.FilePath workspace,
hudson.Launcher launcher,
hudson.model.TaskListener listener) |
boolean |
prebuild(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener) |
all, getProjectAction, needsToRunAfterFinalized, prebuildgetProjectAction, getProjectActions, performpublic static final int MAX_FIELD_LENGTH
public static final int MAX_URL_FIELD_LENGTH
@DataBoundConstructor public StashNotifier(String stashServerBaseUrl, String credentialsId, boolean ignoreUnverifiedSSLPeer, String commitSha1, String buildStatus, String buildName, boolean includeBuildNumberInKey, String projectKey, boolean prependParentProjectKey, boolean disableInprogressNotification, boolean considerUnstableAsSuccess)
public hudson.tasks.BuildStepMonitor getRequiredMonitorService()
getRequiredMonitorService in interface hudson.tasks.BuildSteppublic boolean isDisableInprogressNotification()
public boolean isConsiderUnstableAsSuccess()
public String getCredentialsId()
public String getStashServerBaseUrl()
public boolean getIgnoreUnverifiedSSLPeer()
public String getCommitSha1()
public StashBuildState getBuildStatus()
public String getBuildName()
public boolean getIncludeBuildNumberInKey()
public String getProjectKey()
public boolean getPrependParentProjectKey()
public boolean prebuild(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
prebuild in interface hudson.tasks.BuildStepprebuild in class hudson.tasks.BuildStepCompatibilityLayerpublic boolean perform(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
perform in interface hudson.tasks.BuildStepperform in class hudson.tasks.BuildStepCompatibilityLayerpublic void perform(@Nonnull hudson.model.Run<?,?> run, @Nonnull hudson.FilePath workspace, @Nonnull hudson.Launcher launcher, @Nonnull hudson.model.TaskListener listener) throws InterruptedException, IOException
perform in interface jenkins.tasks.SimpleBuildStepInterruptedExceptionIOExceptionprotected Collection<String> lookupCommitSha1s(hudson.model.Run run, hudson.FilePath workspace, hudson.model.TaskListener listener)
@Deprecated protected org.apache.http.impl.client.CloseableHttpClient getHttpClient(PrintStream logger, hudson.model.Run<?,?> run, String stashServer) throws Exception
ExceptionDefaultApacheHttpNotifier.getHttpClient(PrintStream, URI, boolean)public StashNotifier.DescriptorImpl getDescriptor()
getDescriptor in interface hudson.model.Describable<hudson.tasks.Publisher>getDescriptor in class hudson.tasks.Notifierprotected NotificationResult notifyStash(PrintStream logger, hudson.model.Run<?,?> run, String commitSha1, hudson.model.TaskListener listener, StashBuildState state) throws Exception
logger - the logger to userun - the run to notify Bitbucket ofcommitSha1 - the SHA1 of the run commitlistener - the run listener for loggingstate - the state of the build as defined by the Bitbucket API.Exceptionprotected StashBuildState getPushedBuildStatus(StashBuildState currentBuildStatus)
currentBuildStatus - the state of the current buildprotected org.apache.http.client.methods.HttpPost createRequest(org.apache.http.HttpEntity stashBuildNotificationEntity,
hudson.model.Item project,
String commitSha1,
String url)
throws org.apache.http.auth.AuthenticationException
stashBuildNotificationEntity - a entity containing the parameters for BitbucketcommitSha1 - the SHA1 of the commit that was builturl - org.apache.http.auth.AuthenticationExceptionDefaultApacheHttpNotifier.createRequest(URI, JSONObject, UsernamePasswordCredentials)protected String getBuildKey(hudson.model.Run<?,?> run, hudson.model.TaskListener listener)
run - the run to notify Bitbucket ofprotected String getBuildName(hudson.model.Run<?,?> run)
Run.run - the run to notify Bitbucket ofprotected String getBuildDescription(hudson.model.Run<?,?> run, StashBuildState state)
run - the run to be describedstate - the state of the runCopyright © 2016–2021. All rights reserved.