Package io.github.cdklabs.projen.gitlab
Class Environment.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.gitlab.Environment.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<Environment>
- Enclosing interface:
- Environment
@Stability(Experimental) public static final class Environment.Builder extends Object implements software.amazon.jsii.Builder<Environment>
A builder forEnvironment
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Environment.Builderaction(Action action)Sets the value ofEnvironment.getAction()Environment.BuilderautoStopIn(String autoStopIn)Sets the value ofEnvironment.getAutoStopIn()Environmentbuild()Builds the configured instance.Environment.BuilderdeploymentTier(DeploymentTier deploymentTier)Sets the value ofEnvironment.getDeploymentTier()Environment.Builderkubernetes(KubernetesConfig kubernetes)Sets the value ofEnvironment.getKubernetes()Environment.Buildername(String name)Sets the value ofEnvironment.getName()Environment.BuilderonStop(String onStop)Sets the value ofEnvironment.getOnStop()Environment.Builderurl(String url)Sets the value ofEnvironment.getUrl()
-
-
-
Method Detail
-
name
@Stability(Experimental) public Environment.Builder name(String name)
Sets the value ofEnvironment.getName()- Parameters:
name- The name of the environment, e.g. 'qa', 'staging', 'production'. This parameter is required.- Returns:
this
-
action
@Stability(Experimental) public Environment.Builder action(Action action)
Sets the value ofEnvironment.getAction()- Parameters:
action- Specifies what this job will do. 'start' (default) indicates the job will start the deployment. 'prepare' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment.- Returns:
this
-
autoStopIn
@Stability(Experimental) public Environment.Builder autoStopIn(String autoStopIn)
Sets the value ofEnvironment.getAutoStopIn()- Parameters:
autoStopIn- The amount of time it should take before Gitlab will automatically stop the environment. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'.- Returns:
this
-
deploymentTier
@Stability(Experimental) public Environment.Builder deploymentTier(DeploymentTier deploymentTier)
Sets the value ofEnvironment.getDeploymentTier()- Parameters:
deploymentTier- Explicitly specifies the tier of the deployment environment if non-standard environment name is used.- Returns:
this
-
kubernetes
@Stability(Experimental) public Environment.Builder kubernetes(KubernetesConfig kubernetes)
Sets the value ofEnvironment.getKubernetes()- Parameters:
kubernetes- Used to configure the kubernetes deployment for this environment. This is currently not supported for kubernetes clusters that are managed by Gitlab.- Returns:
this
-
onStop
@Stability(Experimental) public Environment.Builder onStop(String onStop)
Sets the value ofEnvironment.getOnStop()- Parameters:
onStop- The name of a job to execute when the environment is about to be stopped.- Returns:
this
-
url
@Stability(Experimental) public Environment.Builder url(String url)
Sets the value ofEnvironment.getUrl()- Parameters:
url- When set, this will expose buttons in various places for the current environment in Gitlab, that will take you to the defined URL.- Returns:
this
-
build
@Stability(Experimental) public Environment build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<Environment>- Returns:
- a new instance of
Environment - Throws:
NullPointerException- if any required attribute was not provided
-
-