public class DeploymentStepUtils extends Object
Constructor and Description |
---|
DeploymentStepUtils() |
Modifier and Type | Method and Description |
---|---|
static BitbucketDeploymentEnvironment |
getEnvironment(DeploymentStep step,
Run<?,?> run,
TaskListener listener)
Create a
BitbucketDeploymentEnvironment . |
static String |
getOrGenerateEnvironmentKey()
Generates a random UUID to be used as an environment key.
|
static String |
getOrGenerateEnvironmentKey(String environmentKey)
Gets the provided
environmentKey , stripping away whitespace, or generates a random UUID if a blank
environmentKey was provided. |
static BitbucketDeploymentEnvironmentType |
normalizeEnvironmentType(String environmentType)
Converts an environment type String to a
BitbucketDeploymentEnvironmentType . |
public static String getOrGenerateEnvironmentKey()
environmentKey
, or a generated one if the provided one is blankpublic static String getOrGenerateEnvironmentKey(@CheckForNull String environmentKey)
environmentKey
, stripping away whitespace, or generates a random UUID if a blank
environmentKey
was provided.environmentKey
- a unique identifier for the environment, or null
to have one generatedenvironmentKey
, or a generated one if the provided one is blank@CheckForNull public static BitbucketDeploymentEnvironmentType normalizeEnvironmentType(@CheckForNull String environmentType)
BitbucketDeploymentEnvironmentType
.environmentType
- the Enum.name()
BitbucketDeploymentEnvironmentType
or null
if there is none that matchpublic static BitbucketDeploymentEnvironment getEnvironment(DeploymentStep step, Run<?,?> run, TaskListener listener)
BitbucketDeploymentEnvironment
.step
- the DeploymentStep
being executedrun
- the Run
listener
- the TaskListener
BitbucketDeploymentEnvironment
configured by the provided stepCopyright © 2016–2022. All rights reserved.