Package hudson.plugins.octopusdeploy
Class AbstractOctopusDeployRecorderBuildStep
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- hudson.plugins.octopusdeploy.AbstractOctopusDeployRecorderBuildStep
-
- All Implemented Interfaces:
hudson.ExtensionPoint
,hudson.model.Describable<hudson.tasks.Builder>
,hudson.tasks.BuildStep
,jenkins.tasks.SimpleBuildStep
- Direct Known Subclasses:
OctopusDeployPackRecorder
,OctopusDeployPushBuildInformationRecorder
,OctopusDeployPushRecorder
public abstract class AbstractOctopusDeployRecorderBuildStep extends hudson.tasks.Builder implements jenkins.tasks.SimpleBuildStep
The AbstractOctopusDeployRecorder tries to take care of most of the Octopus Deploy server access.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractOctopusDeployRecorderBuildStep.AbstractOctopusDeployDescriptorImplStep
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
additionalArgs
The additional arguments to pass to Octopus CLIprotected boolean
cancelOnTimeout
Whether to cancel the deployment if the deployment timeout is reachedprotected java.lang.String
deploymentTimeout
Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00)protected java.lang.String
environment
The environment to deploy to, if we are deploying.protected OctopusDeployServer
octopusDeployServer
Cache for OctopusDeployServer instance used in deployment transient keyword prevents leaking API key to Job configurationprotected java.lang.String
project
The project name as defined in Octopus.protected java.lang.String
serverId
The serverId to use for this deploymentprotected java.lang.String
spaceId
The spaceId to use for this deploymentprotected java.lang.String
tenant
The Tenant to use for a deploy to in Octopus.protected java.lang.String
tenantTag
protected java.lang.String
toolId
The toolId to use for this deploymentprotected java.lang.String
variables
The variables to use for a deploy to in Octopus.protected boolean
verboseLogging
Whether or not to enable verbose loggingprotected boolean
waitForDeployment
Whether or not perform will return control immediately, or wait until the Deployment task is completed.
-
Constructor Summary
Constructors Constructor Description AbstractOctopusDeployRecorderBuildStep()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAdditionalArgs()
OctopusApi
getApi()
Get OctopusApi instance for this deploymentboolean
getCancelOnTimeout()
protected static OctopusDeployServer
getDefaultOctopusDeployServer()
Get the default OctopusDeployServer from OctopusDeployPlugin configurationjava.lang.String
getDeploymentTimeout()
java.lang.String
getEnvironment()
protected static java.lang.String
getExceptionMessage(java.lang.Exception ex)
OctopusDeployServer
getOctopusDeployServer()
static OctopusDeployServer
getOctopusDeployServer(java.lang.String serverId)
Get the instance of OctopusDeployServer by serverIdstatic java.util.List<OctopusDeployServer>
getOctopusDeployServers()
Get the list of OctopusDeployServer from OctopusDeployPlugin configurationstatic java.util.List<java.lang.String>
getOctopusDeployServersIds()
static java.util.List<java.lang.String>
getOctopusToolIds()
static OctoInstallation[]
getOctopusToolInstallations()
static java.lang.String
getOctopusToolPath(java.lang.String name, hudson.model.Node builtOn, hudson.EnvVars env, hudson.model.TaskListener taskListener)
java.lang.String
getProject()
hudson.tasks.BuildStepMonitor
getRequiredMonitorService()
java.lang.String
getServerId()
java.lang.String
getSpaceId()
java.lang.String
getTenant()
java.lang.String
getTenantTag()
java.lang.String
getToolId()
java.lang.String
getVariables()
boolean
getVerboseLogging()
boolean
getWaitForDeployment()
java.lang.Boolean
hasAdvancedOptions()
static java.lang.Boolean
hasSpaces()
hudson.model.Result
launchOcto(hudson.FilePath workspace, hudson.Launcher launcher, java.util.List<java.lang.String> commands, java.lang.Boolean[] masks, hudson.EnvVars environment, hudson.model.BuildListener listener)
void
setAdditionalArgs(java.lang.String additionalArgs)
void
setVerboseLogging(boolean verboseLogging)
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
octopusDeployServer
protected transient OctopusDeployServer octopusDeployServer
Cache for OctopusDeployServer instance used in deployment transient keyword prevents leaking API key to Job configuration
-
serverId
protected java.lang.String serverId
The serverId to use for this deployment
-
toolId
protected java.lang.String toolId
The toolId to use for this deployment
-
spaceId
protected java.lang.String spaceId
The spaceId to use for this deployment
-
project
protected java.lang.String project
The project name as defined in Octopus.
-
environment
protected java.lang.String environment
The environment to deploy to, if we are deploying.
-
variables
protected java.lang.String variables
The variables to use for a deploy to in Octopus.
-
tenant
protected java.lang.String tenant
The Tenant to use for a deploy to in Octopus.
-
tenantTag
protected java.lang.String tenantTag
-
additionalArgs
protected java.lang.String additionalArgs
The additional arguments to pass to Octopus CLI
-
waitForDeployment
protected boolean waitForDeployment
Whether or not perform will return control immediately, or wait until the Deployment task is completed.
-
verboseLogging
protected boolean verboseLogging
Whether or not to enable verbose logging
-
deploymentTimeout
protected java.lang.String deploymentTimeout
Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00)
-
cancelOnTimeout
protected boolean cancelOnTimeout
Whether to cancel the deployment if the deployment timeout is reached
-
-
Method Detail
-
getOctopusDeployServer
public OctopusDeployServer getOctopusDeployServer() throws ServerConfigurationNotFoundException
-
getServerId
public java.lang.String getServerId()
-
getToolId
public java.lang.String getToolId()
-
getSpaceId
public java.lang.String getSpaceId()
-
hasSpaces
public static java.lang.Boolean hasSpaces()
-
getProject
public java.lang.String getProject()
-
getEnvironment
public java.lang.String getEnvironment()
-
getVariables
public java.lang.String getVariables()
-
getTenant
public java.lang.String getTenant()
-
getTenantTag
public java.lang.String getTenantTag()
-
getAdditionalArgs
public java.lang.String getAdditionalArgs()
-
setAdditionalArgs
@DataBoundSetter public void setAdditionalArgs(java.lang.String additionalArgs)
-
getWaitForDeployment
public boolean getWaitForDeployment()
-
getVerboseLogging
public boolean getVerboseLogging()
-
setVerboseLogging
@DataBoundSetter public void setVerboseLogging(boolean verboseLogging)
-
getDeploymentTimeout
public java.lang.String getDeploymentTimeout()
-
getCancelOnTimeout
public boolean getCancelOnTimeout()
-
getDefaultOctopusDeployServer
protected static OctopusDeployServer getDefaultOctopusDeployServer()
Get the default OctopusDeployServer from OctopusDeployPlugin configuration- Returns:
- the default server
-
getOctopusDeployServers
public static java.util.List<OctopusDeployServer> getOctopusDeployServers()
Get the list of OctopusDeployServer from OctopusDeployPlugin configuration- Returns:
- all configured servers
-
getOctopusDeployServersIds
public static java.util.List<java.lang.String> getOctopusDeployServersIds()
-
getOctopusToolInstallations
public static OctoInstallation[] getOctopusToolInstallations()
-
getOctopusToolIds
public static java.util.List<java.lang.String> getOctopusToolIds()
-
getOctopusToolPath
public static java.lang.String getOctopusToolPath(java.lang.String name, hudson.model.Node builtOn, hudson.EnvVars env, hudson.model.TaskListener taskListener)
-
getOctopusDeployServer
public static OctopusDeployServer getOctopusDeployServer(java.lang.String serverId) throws ServerConfigurationNotFoundException
Get the instance of OctopusDeployServer by serverId- Parameters:
serverId
- The id of OctopusDeployServer in the configuration.- Returns:
- the server by id
- Throws:
ServerConfigurationNotFoundException
-
hasAdvancedOptions
public java.lang.Boolean hasAdvancedOptions()
-
getApi
public OctopusApi getApi() throws ServerConfigurationNotFoundException
Get OctopusApi instance for this deployment- Returns:
- the api for a given server
- Throws:
ServerConfigurationNotFoundException
-
launchOcto
public hudson.model.Result launchOcto(hudson.FilePath workspace, hudson.Launcher launcher, java.util.List<java.lang.String> commands, java.lang.Boolean[] masks, hudson.EnvVars environment, hudson.model.BuildListener listener)
-
getRequiredMonitorService
public hudson.tasks.BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfacehudson.tasks.BuildStep
- Overrides:
getRequiredMonitorService
in classhudson.tasks.Builder
-
getExceptionMessage
protected static java.lang.String getExceptionMessage(java.lang.Exception ex)
-
-