public class StashNotifier extends Notifier implements SimpleBuildStep
Only basic authentication is supported at the moment.
| Modifier and Type | Class and Description |
|---|---|
static class |
StashNotifier.DescriptorImpl |
Publisher.DescriptorExtensionListImplSimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactoryBuildStep.PublisherListExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_FIELD_LENGTH |
static int |
MAX_URL_FIELD_LENGTH |
BUILDERS, PUBLISHERS| Constructor and Description |
|---|
StashNotifier() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.client.methods.HttpPost |
createRequest(org.apache.http.HttpEntity stashBuildNotificationEntity,
Item project,
String commitSha1,
String url)
Deprecated.
in favor of method overload
|
protected String |
getBuildDescription(Run<?,?> run,
StashBuildState state)
Returns the description of the run used for the Bitbucket notification.
|
protected String |
getBuildKey(Run<?,?> run,
TaskListener listener)
Returns the run key used in the Bitbucket notification.
|
String |
getBuildName() |
protected String |
getBuildName(Run<?,?> run)
Returns the build name to be pushed.
|
StashBuildState |
getBuildStatus() |
String |
getBuildUrl() |
protected String |
getBuildUrl(Run<?,?> run)
Returns the build url to be pushed.
|
String |
getCommitSha1() |
String |
getCredentialsId() |
StashNotifier.DescriptorImpl |
getDescriptor() |
protected org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(PrintStream logger,
Run<?,?> run,
String stashServer)
Deprecated.
|
String |
getProjectKey() |
protected StashBuildState |
getPushedBuildStatus(StashBuildState currentBuildStatus)
Returns the build state to be pushed.
|
BuildStepMonitor |
getRequiredMonitorService() |
String |
getStashServerBaseUrl() |
boolean |
isConsiderUnstableAsSuccess() |
boolean |
isDisableInprogressNotification() |
boolean |
isIgnoreUnverifiedSSLPeer() |
boolean |
isIncludeBuildNumberInKey() |
boolean |
isPrependParentProjectKey() |
protected Collection<String> |
lookupCommitSha1s(Run run,
FilePath workspace,
TaskListener listener) |
protected NotificationResult |
notifyStash(PrintStream logger,
Run<?,?> run,
String commitSha1,
TaskListener listener,
StashBuildState state)
Notifies the configured Bitbucket server by POSTing the run results
to the Bitbucket run API.
|
boolean |
perform(AbstractBuild<?,?> build,
Launcher launcher,
BuildListener listener) |
void |
perform(Run<?,?> run,
FilePath workspace,
Launcher launcher,
TaskListener listener) |
boolean |
prebuild(AbstractBuild<?,?> build,
BuildListener listener) |
void |
setBuildName(String buildName) |
void |
setBuildStatus(Object buildStatus) |
void |
setBuildUrl(String buildUrl) |
void |
setCommitSha1(String commitSha1) |
void |
setConsiderUnstableAsSuccess(boolean considerUnstableAsSuccess) |
void |
setCredentialsId(String credentialsId) |
void |
setDisableInprogressNotification(boolean disableInprogressNotification) |
void |
setIgnoreUnverifiedSSLPeer(boolean ignoreUnverifiedSSLPeer) |
void |
setIncludeBuildNumberInKey(boolean includeBuildNumberInKey) |
void |
setPrependParentProjectKey(boolean prependParentProjectKey) |
void |
setProjectKey(String projectKey) |
void |
setStashServerBaseUrl(String stashServerBaseUrl) |
all, getProjectAction, needsToRunAfterFinalized, prebuildgetProjectAction, getProjectActions, performclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitperform, perform, requiresWorkspacegetProjectAction, getProjectActionspublic static final int MAX_FIELD_LENGTH
public static final int MAX_URL_FIELD_LENGTH
public BuildStepMonitor getRequiredMonitorService()
getRequiredMonitorService in interface BuildSteppublic String getStashServerBaseUrl()
@DataBoundSetter public void setStashServerBaseUrl(String stashServerBaseUrl)
public String getCredentialsId()
@DataBoundSetter public void setCredentialsId(String credentialsId)
public boolean isIgnoreUnverifiedSSLPeer()
@DataBoundSetter public void setIgnoreUnverifiedSSLPeer(boolean ignoreUnverifiedSSLPeer)
public String getCommitSha1()
@DataBoundSetter public void setCommitSha1(String commitSha1)
public StashBuildState getBuildStatus()
@DataBoundSetter public void setBuildStatus(Object buildStatus)
public String getBuildName()
@DataBoundSetter public void setBuildName(String buildName)
public String getBuildUrl()
@DataBoundSetter public void setBuildUrl(String buildUrl)
public boolean isIncludeBuildNumberInKey()
@DataBoundSetter public void setIncludeBuildNumberInKey(boolean includeBuildNumberInKey)
public String getProjectKey()
@DataBoundSetter public void setProjectKey(String projectKey)
public boolean isPrependParentProjectKey()
@DataBoundSetter public void setPrependParentProjectKey(boolean prependParentProjectKey)
public boolean isDisableInprogressNotification()
@DataBoundSetter public void setDisableInprogressNotification(boolean disableInprogressNotification)
public boolean isConsiderUnstableAsSuccess()
@DataBoundSetter public void setConsiderUnstableAsSuccess(boolean considerUnstableAsSuccess)
public boolean prebuild(AbstractBuild<?,?> build, BuildListener listener)
prebuild in interface BuildStepprebuild in class BuildStepCompatibilityLayerpublic boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener)
perform in interface BuildStepperform in class BuildStepCompatibilityLayerpublic void perform(@NonNull
Run<?,?> run,
@NonNull
FilePath workspace,
@NonNull
Launcher launcher,
@NonNull
TaskListener listener)
perform in interface SimpleBuildStepprotected Collection<String> lookupCommitSha1s(Run run, FilePath workspace, TaskListener listener)
@Deprecated protected org.apache.http.impl.client.CloseableHttpClient getHttpClient(PrintStream logger, Run<?,?> run, String stashServer) throws Exception
ExceptionDefaultApacheHttpNotifier.getHttpClient(PrintStream, URI, boolean)public StashNotifier.DescriptorImpl getDescriptor()
getDescriptor in interface Describable<Publisher>getDescriptor in class Notifierprotected NotificationResult notifyStash(PrintStream logger, Run<?,?> run, String commitSha1, TaskListener listener, StashBuildState state)
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.protected StashBuildState getPushedBuildStatus(StashBuildState currentBuildStatus)
currentBuildStatus - the state of the current buildprotected org.apache.http.client.methods.HttpPost createRequest(org.apache.http.HttpEntity stashBuildNotificationEntity,
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 - Bitbucket URLorg.apache.http.auth.AuthenticationExceptionDefaultApacheHttpNotifier.createRequest(URI, JSONObject, Credentials, NotificationContext)protected String getBuildKey(Run<?,?> run, TaskListener listener)
run - the run to notify Bitbucket ofprotected String getBuildName(Run<?,?> run)
Run.run - the run to notify Bitbucket ofprotected String getBuildUrl(Run<?,?> run)
DisplayURLProvider.run - the run to notify Bitbucket ofprotected String getBuildDescription(Run<?,?> run, StashBuildState state)
run - the run to be describedstate - the state of the runCopyright © 2016–2022. All rights reserved.