Class DeploymentStepUtils
java.lang.Object
com.atlassian.bitbucket.jenkins.internal.deployments.DeploymentStepUtils
- Since:
- 3.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEnvironment(DeploymentStep step, Run<?, ?> run, TaskListener listener) Create aBitbucketDeploymentEnvironment.static StringGenerates a random UUID to be used as an environment key.static StringgetOrGenerateEnvironmentKey(String environmentKey) Gets the providedenvironmentKey, stripping away whitespace, or generates a random UUID if a blankenvironmentKeywas provided.normalizeEnvironmentType(String environmentType) Converts an environment type String to aBitbucketDeploymentEnvironmentType.
-
Constructor Details
-
DeploymentStepUtils
public DeploymentStepUtils()
-
-
Method Details
-
getOrGenerateEnvironmentKey
Generates a random UUID to be used as an environment key.- Returns:
- the generated
environmentKey, or a generated one if the provided one is blank
-
getOrGenerateEnvironmentKey
Gets the providedenvironmentKey, stripping away whitespace, or generates a random UUID if a blankenvironmentKeywas provided.- Parameters:
environmentKey- a unique identifier for the environment, ornullto have one generated- Returns:
- the provided
environmentKey, or a generated one if the provided one is blank
-
normalizeEnvironmentType
@CheckForNull public static BitbucketDeploymentEnvironmentType normalizeEnvironmentType(@CheckForNull String environmentType) Converts an environment type String to aBitbucketDeploymentEnvironmentType.- Parameters:
environmentType- theEnum.name()- Returns:
- the associated
BitbucketDeploymentEnvironmentTypeornullif there is none that match
-
getEnvironment
public static BitbucketDeploymentEnvironment getEnvironment(DeploymentStep step, Run<?, ?> run, TaskListener listener) Create aBitbucketDeploymentEnvironment.- Parameters:
step- theDeploymentStepbeing executedrun- theRunlistener- theTaskListener- Returns:
- the
BitbucketDeploymentEnvironmentconfigured by the provided step
-