Class ContainerOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.github.workflows.ContainerOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ContainerOptions>
- Enclosing interface:
- ContainerOptions
@Stability(Experimental) public static final class ContainerOptions.Builder extends Object implements software.amazon.jsii.Builder<ContainerOptions>
A builder forContainerOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerOptionsbuild()Builds the configured instance.ContainerOptions.Buildercredentials(ContainerCredentials credentials)Sets the value ofContainerOptions.getCredentials()ContainerOptions.Builderenv(Map<String,String> env)Sets the value ofContainerOptions.getEnv()ContainerOptions.Builderimage(String image)Sets the value ofContainerOptions.getImage()ContainerOptions.Builderoptions(List<String> options)Sets the value ofContainerOptions.getOptions()ContainerOptions.Builderports(List<? extends Number> ports)Sets the value ofContainerOptions.getPorts()ContainerOptions.Buildervolumes(List<String> volumes)Sets the value ofContainerOptions.getVolumes()
-
-
-
Method Detail
-
image
@Stability(Experimental) public ContainerOptions.Builder image(String image)
Sets the value ofContainerOptions.getImage()- Parameters:
image- The Docker image to use as the container to run the action. This parameter is required. The value can be the Docker Hub image name or a registry name.- Returns:
this
-
credentials
@Stability(Experimental) public ContainerOptions.Builder credentials(ContainerCredentials credentials)
Sets the value ofContainerOptions.getCredentials()- Parameters:
credentials- f the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. The credentials are the same values that you would provide to the docker login command.- Returns:
this
-
env
@Stability(Experimental) public ContainerOptions.Builder env(Map<String,String> env)
Sets the value ofContainerOptions.getEnv()- Parameters:
env- Sets a map of environment variables in the container.- Returns:
this
-
options
@Stability(Experimental) public ContainerOptions.Builder options(List<String> options)
Sets the value ofContainerOptions.getOptions()- Parameters:
options- Additional Docker container resource options.- Returns:
this
-
ports
@Stability(Experimental) public ContainerOptions.Builder ports(List<? extends Number> ports)
Sets the value ofContainerOptions.getPorts()- Parameters:
ports- Sets an array of ports to expose on the container.- Returns:
this
-
volumes
@Stability(Experimental) public ContainerOptions.Builder volumes(List<String> volumes)
Sets the value ofContainerOptions.getVolumes()- Parameters:
volumes- Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.To specify a volume, you specify the source and destination path:
<source>:<destinationPath>.- Returns:
this
-
build
@Stability(Experimental) public ContainerOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ContainerOptions>- Returns:
- a new instance of
ContainerOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-