Class DeploymentStepUtils
- java.lang.Object
 - 
- com.atlassian.bitbucket.jenkins.internal.deployments.DeploymentStepUtils
 
 
- 
public class DeploymentStepUtils extends Object
- Since:
 - 3.1.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DeploymentStepUtils() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BitbucketDeploymentEnvironmentgetEnvironment(DeploymentStep step, Run<?,?> run, TaskListener listener)Create aBitbucketDeploymentEnvironment.static StringgetOrGenerateEnvironmentKey()Generates 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.static BitbucketDeploymentEnvironmentTypenormalizeEnvironmentType(String environmentType)Converts an environment type String to aBitbucketDeploymentEnvironmentType. 
 - 
 
- 
- 
Method Detail
- 
getOrGenerateEnvironmentKey
public static String 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
public static String getOrGenerateEnvironmentKey(@CheckForNull String environmentKey)
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 
 
 - 
 
 -