@ParametersAreNullableByDefault public class RemoteBuildConfiguration extends Builder implements SimpleBuildStep, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
RemoteBuildConfiguration.DescriptorImpl |
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
BuildStep.PublisherList
ExtensionPoint.LegacyInstancesAreScopedToHudson
BUILDERS, PUBLISHERS
Constructor and Description |
---|
RemoteBuildConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
abortRemoteTask(RemoteJenkinsServer remoteServer,
Handle handle,
BuildContext context) |
ConnectionResponse |
doGet(String urlString,
BuildContext context,
RemoteBuildStatus remoteBuildStatus)
Orchestrates all calls to the remote server.
|
RemoteJenkinsServer |
evaluateEffectiveRemoteHost(BasicBuildContext context)
Tries to identify the effective Remote Host configuration based on the
different parameters like
remoteJenkinsName and the globally
configured remote host, remoteJenkinsURL which overrides the
address locally or job which can be a full job URL. |
protected void |
failBuild(Exception e,
PrintStream logger)
Convenience function to mark the build as failed.
|
RemoteJenkinsServer |
findRemoteHost(String displayName)
Lookup up the globally configured Remote Jenkins Server based on display name
|
protected static URL |
generateEffectiveRemoteBuildURL(URL remoteBuildURL,
String effectiveRemoteServerAddress) |
protected static String |
generateJobUrl(RemoteJenkinsServer remoteServer,
String jobNameOrUrl) |
Auth2 |
getAuth2() |
boolean |
getBlockBuildUntilComplete() |
int |
getConnectionRetryLimit() |
RemoteBuildConfiguration.DescriptorImpl |
getDescriptor() |
boolean |
getEnhancedLogging() |
int |
getHttpGetReadTimeout() |
int |
getHttpPostReadTimeout() |
String |
getJob() |
Semaphore |
getLock(String addr) |
int |
getMaxConn() |
boolean |
getOverrideAuth()
Deprecated.
since 2.3.0-SNAPSHOT - use
getAuth2() instead. |
boolean |
getOverrideTrustAllCertificates() |
Map<String,String> |
getParameterMap(BuildContext context) |
JobParameters |
getParameters2() |
int |
getPollInterval(RemoteBuildStatus remoteBuildStatus) |
boolean |
getPreventRemoteBuildQueue() |
String |
getRemoteJenkinsName() |
String |
getRemoteJenkinsUrl() |
boolean |
getShouldNotFailBuild() |
String |
getToken() |
boolean |
getTrustAllCertificates() |
boolean |
isAbortTriggeredJob() |
boolean |
isDisabled() |
boolean |
isStepDisabled(PrintStream printStream) |
boolean |
isUseCrumbCache() |
boolean |
isUseJobInfoCache() |
boolean |
perform(AbstractBuild<?,?> build,
Launcher launcher,
BuildListener listener) |
void |
perform(Run<?,?> build,
FilePath workspace,
Launcher launcher,
TaskListener listener)
Triggers the remote job and, waits until completion if
blockBuildUntilComplete is set. |
Handle |
performTriggerAndGetQueueId(BuildContext context)
Triggers the remote job, identifies the queue ID and, returns a
Handle to this remote execution. |
void |
performWaitForBuild(BuildContext context,
Handle handle)
Checks the remote build status and, waits for completion if
blockBuildUntilComplete is set. |
protected Object |
readResolve() |
protected static String |
removeHashParameters(String string) |
protected static String |
removeQueryParameters(String string) |
protected static String |
removeTrailingSlashes(String string) |
void |
setAbortTriggeredJob(boolean abortTriggeredJob) |
void |
setAuth2(Auth2 auth) |
void |
setBlockBuildUntilComplete(boolean blockBuildUntilComplete) |
void |
setDisabled(boolean disabled) |
void |
setEnhancedLogging(boolean enhancedLogging) |
void |
setHttpGetReadTimeout(int readTimeout) |
void |
setHttpPostReadTimeout(int readTimeout) |
void |
setJob(String job) |
void |
setMaxConn(int maxConn) |
void |
setOverrideTrustAllCertificates(boolean overrideTrustAllCertificates) |
void |
setParameters(String parameters) |
void |
setParameters2(JobParameters parameters2) |
void |
setPollInterval(int pollInterval) |
void |
setPreventRemoteBuildQueue(boolean preventRemoteBuildQueue) |
void |
setRemoteJenkinsName(String remoteJenkinsName) |
void |
setRemoteJenkinsUrl(String remoteJenkinsUrl) |
void |
setShouldNotFailBuild(boolean shouldNotFailBuild) |
void |
setToken(String token) |
void |
setTrustAllCertificates(boolean trustAllCertificates) |
void |
setUseCrumbCache(boolean useCrumbCache) |
void |
setUseJobInfoCache(boolean useJobInfoCache) |
RemoteBuildInfo |
updateBuildInfo(RemoteBuildInfo buildInfo,
BuildContext context) |
all, getRequiredMonitorService, prebuild
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
perform, perform, requiresWorkspace
getProjectAction, getProjectActions, getRequiredMonitorService, prebuild
protected Object readResolve()
@DataBoundSetter public void setTrustAllCertificates(boolean trustAllCertificates)
@DataBoundSetter public void setOverrideTrustAllCertificates(boolean overrideTrustAllCertificates)
@DataBoundSetter public void setAbortTriggeredJob(boolean abortTriggeredJob)
@DataBoundSetter public void setMaxConn(int maxConn)
@DataBoundSetter public void setRemoteJenkinsName(String remoteJenkinsName)
@DataBoundSetter public void setRemoteJenkinsUrl(String remoteJenkinsUrl)
@DataBoundSetter public void setAuth2(Auth2 auth)
@DataBoundSetter public void setParameters2(JobParameters parameters2)
@DataBoundSetter public void setShouldNotFailBuild(boolean shouldNotFailBuild)
@DataBoundSetter public void setPreventRemoteBuildQueue(boolean preventRemoteBuildQueue)
@DataBoundSetter public void setHttpGetReadTimeout(int readTimeout)
@DataBoundSetter public void setHttpPostReadTimeout(int readTimeout)
@DataBoundSetter public void setPollInterval(int pollInterval)
@DataBoundSetter public void setBlockBuildUntilComplete(boolean blockBuildUntilComplete)
@DataBoundSetter public void setJob(String job)
@DataBoundSetter public void setToken(String token)
@DataBoundSetter public void setParameters(String parameters)
@DataBoundSetter public void setEnhancedLogging(boolean enhancedLogging)
@DataBoundSetter public void setDisabled(boolean disabled)
@DataBoundSetter public void setUseJobInfoCache(boolean useJobInfoCache)
@DataBoundSetter public void setUseCrumbCache(boolean useCrumbCache)
public Map<String,String> getParameterMap(BuildContext context) throws AbortException
AbortException
@Nonnull public RemoteJenkinsServer evaluateEffectiveRemoteHost(BasicBuildContext context) throws IOException
remoteJenkinsName
and the globally
configured remote host, remoteJenkinsURL
which overrides the
address locally or job
which can be a full job URL.context
- the context of this Builder/BuildStep.RemoteJenkinsServer
a RemoteJenkinsServer object, never null.AbortException
- if no server found and remoteJenkinsUrl empty.MalformedURLException
- if remoteJenkinsName
no valid URL
or job
an URL but nor valid.IOException
@Nullable @CheckForNull public RemoteJenkinsServer findRemoteHost(String displayName)
displayName
- Name of the configuration you are looking forprotected void failBuild(Exception e, PrintStream logger) throws IOException
e
- exception that caused the build to fail.logger
- build listener.IOException
- if the build fails and shouldNotFailBuild
is
not set.public void abortRemoteTask(RemoteJenkinsServer remoteServer, Handle handle, BuildContext context) throws IOException, InterruptedException
IOException
InterruptedException
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException, IllegalArgumentException
perform
in interface BuildStep
perform
in class BuildStepCompatibilityLayer
InterruptedException
IOException
IllegalArgumentException
public boolean isStepDisabled(PrintStream printStream)
public void perform(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException
blockBuildUntilComplete
is set.perform
in interface SimpleBuildStep
InterruptedException
- if any thread has interrupted the current
thread.IOException
- if there is an error retrieving the remote build
data, or, if there is an error retrieving the
remote build status, or, if there is an error
retrieving the console output of the remote
build, or, if the remote build does not succeed.public Handle performTriggerAndGetQueueId(@NonNull BuildContext context) throws IOException, InterruptedException
Handle
to this remote execution.context
- the context of this Builder/BuildStep.IOException
- if there is an error triggering the remote job.InterruptedException
- if any thread has interrupted the current
thread.public void performWaitForBuild(BuildContext context, Handle handle) throws IOException, InterruptedException
blockBuildUntilComplete
is set.context
- the context of this Builder/BuildStep.handle
- the handle to the remote execution.InterruptedException
- if any thread has interrupted the current
thread.IOException
- if any HTTP error or business logic error@Nonnull public RemoteBuildInfo updateBuildInfo(@Nonnull RemoteBuildInfo buildInfo, @Nonnull BuildContext context) throws IOException, InterruptedException
IOException
InterruptedException
protected static URL generateEffectiveRemoteBuildURL(URL remoteBuildURL, String effectiveRemoteServerAddress) throws AbortException
AbortException
public ConnectionResponse doGet(String urlString, BuildContext context, RemoteBuildStatus remoteBuildStatus) throws IOException, InterruptedException
urlString
- the URL that needs to be called.context
- the context of this Builder/BuildStep.remoteBuildStatus
- the build status of a remote build.InterruptedException
- if any thread has interrupted the current
thread.IOException
- if any HTTP error occurred.public boolean isAbortTriggeredJob()
public int getMaxConn()
public String getRemoteJenkinsName()
public String getRemoteJenkinsUrl()
job
!public int getHttpGetReadTimeout()
public int getHttpPostReadTimeout()
public boolean getOverrideAuth()
getAuth2()
instead.public Auth2 getAuth2()
public boolean getShouldNotFailBuild()
public boolean getPreventRemoteBuildQueue()
public int getPollInterval(RemoteBuildStatus remoteBuildStatus)
public boolean getBlockBuildUntilComplete()
public String getJob()
job
value. Can be a job name or full job
URL.public String getToken()
public boolean getEnhancedLogging()
public JobParameters getParameters2()
public int getConnectionRetryLimit()
public boolean isDisabled()
protected static String generateJobUrl(RemoteJenkinsServer remoteServer, String jobNameOrUrl) throws AbortException
AbortException
public RemoteBuildConfiguration.DescriptorImpl getDescriptor()
getDescriptor
in interface Describable<Builder>
getDescriptor
in class Builder
public boolean isUseCrumbCache()
public boolean isUseJobInfoCache()
public boolean getTrustAllCertificates()
public boolean getOverrideTrustAllCertificates()
Copyright © 2016–2023. All rights reserved.