public class StashNotifier
extends hudson.tasks.Notifier
Only basic authentication is supported at the moment.
| Modifier and Type | Class and Description |
|---|---|
static class |
StashNotifier.DescriptorImpl |
hudson.tasks.Publisher.DescriptorExtensionListImpl| 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,
boolean includeBuildNumberInKey,
String projectKey,
boolean prependParentProjectKey,
boolean disableInprogressNotification) |
| 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)
Returns the HTTP POST request ready to be sent to the Stash build API for
the given build and change set.
|
protected String |
getBuildDescription(hudson.model.AbstractBuild<?,?> build,
StashBuildState state)
Returns the description of the build used for the Stash notification.
|
protected String |
getBuildKey(hudson.model.AbstractBuild<?,?> build,
hudson.model.BuildListener listener)
Returns the build key used in the Stash notification.
|
String |
getCommitSha1() |
String |
getCredentialsId() |
StashNotifier.DescriptorImpl |
getDescriptor() |
protected org.apache.http.client.HttpClient |
getHttpClient(PrintStream logger,
hudson.model.AbstractBuild<?,?> build)
Returns the HttpClient through which the REST call is made.
|
boolean |
getIgnoreUnverifiedSSLPeer() |
boolean |
getIncludeBuildNumberInKey() |
boolean |
getPrependParentProjectKey() |
String |
getProjectKey() |
hudson.tasks.BuildStepMonitor |
getRequiredMonitorService() |
String |
getStashServerBaseUrl() |
boolean |
isDisableInprogressNotification() |
protected Collection<String> |
lookupCommitSha1s(hudson.model.AbstractBuild build,
hudson.model.BuildListener listener) |
protected <C extends com.cloudbees.plugins.credentials.Credentials> |
lookupCredentials(Class<C> type,
hudson.model.Item item,
org.acegisecurity.Authentication authentication,
ArrayList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the specified Item. |
protected <C extends com.cloudbees.plugins.credentials.Credentials> |
lookupCredentials(Class<C> type,
hudson.model.ItemGroup<?> itemGroup,
org.acegisecurity.Authentication authentication,
ArrayList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements)
Returns all credentials which are available to the specified
Authentication
for use by the specified Item. |
protected NotificationResult |
notifyStash(PrintStream logger,
hudson.model.AbstractBuild<?,?> build,
String commitSha1,
hudson.model.BuildListener listener,
StashBuildState state)
Notifies the configured Stash server by POSTing the build results
to the Stash build API.
|
boolean |
perform(hudson.model.AbstractBuild<?,?> build,
hudson.Launcher launcher,
hudson.model.BuildListener 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
public hudson.tasks.BuildStepMonitor getRequiredMonitorService()
public boolean isDisableInprogressNotification()
public String getCredentialsId()
public String getStashServerBaseUrl()
public boolean getIgnoreUnverifiedSSLPeer()
public String getCommitSha1()
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.BuildStepCompatibilityLayerprotected Collection<String> lookupCommitSha1s(hudson.model.AbstractBuild build, hudson.model.BuildListener listener)
protected org.apache.http.client.HttpClient getHttpClient(PrintStream logger, hudson.model.AbstractBuild<?,?> build) throws Exception
logger - the logger to log messages tobuild - Exceptionpublic StashNotifier.DescriptorImpl getDescriptor()
getDescriptor in interface hudson.model.Describable<hudson.tasks.Publisher>getDescriptor in class hudson.tasks.Notifierprotected NotificationResult notifyStash(PrintStream logger, hudson.model.AbstractBuild<?,?> build, String commitSha1, hudson.model.BuildListener listener, StashBuildState state) throws Exception
logger - the logger to usebuild - the build to notify Stash ofcommitSha1 - the SHA1 of the built commitlistener - the build listener for loggingstate - the state of the build as defined by the Stash API.Exceptionprotected <C extends com.cloudbees.plugins.credentials.Credentials> List<C> lookupCredentials(Class<C> type, hudson.model.Item item, org.acegisecurity.Authentication authentication, ArrayList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements)
Authentication
for use by the specified Item.C - the credentials type.type - the type of credentials to get.authentication - the authentication.item - the item.domainRequirements - the credential domains to match.protected <C extends com.cloudbees.plugins.credentials.Credentials> List<C> lookupCredentials(Class<C> type, hudson.model.ItemGroup<?> itemGroup, org.acegisecurity.Authentication authentication, ArrayList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements)
Authentication
for use by the specified Item.C - the credentials type.type - the type of credentials to get.authentication - the authentication.itemGroup - the item group.domainRequirements - the credential domains to match.protected org.apache.http.client.methods.HttpPost createRequest(org.apache.http.HttpEntity stashBuildNotificationEntity,
hudson.model.Item project,
String commitSha1)
stashBuildNotificationEntity - a entity containing the parameters
for StashcommitSha1 - the SHA1 of the commit that was builtprotected String getBuildKey(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener)
build - the build to notify Stash ofprotected String getBuildDescription(hudson.model.AbstractBuild<?,?> build, StashBuildState state)
build - the build to be describedstate - the state of the buildCopyright © 2004-2016. All Rights Reserved.