Class: AWSCDK::CodeBuild::BuildEnvironment
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CodeBuild::BuildEnvironment
- Defined in:
- code_build/build_environment.rb
Instance Attribute Summary collapse
-
#build_image ⇒ AWSCDK::CodeBuild::IBuildImage?
readonly
The image used for the builds.
-
#certificate ⇒ AWSCDK::CodeBuild::BuildEnvironmentCertificate?
readonly
The location of the PEM-encoded certificate for the build project.
-
#compute_type ⇒ AWSCDK::CodeBuild::ComputeType?
readonly
The type of compute to use for this build.
-
#docker_server ⇒ AWSCDK::CodeBuild::DockerServerOptions?
readonly
The Docker server configuration CodeBuild use to build your Docker image.
-
#environment_variables ⇒ Hash{String => AWSCDK::CodeBuild::BuildEnvironmentVariable}?
readonly
The environment variables that your builds can use.
-
#fleet ⇒ AWSCDK::CodeBuild::IFleet?
readonly
Fleet resource for a reserved capacity CodeBuild project.
-
#privileged ⇒ Boolean?
readonly
Indicates how the project builds Docker images.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(build_image: nil, certificate: nil, compute_type: nil, docker_server: nil, environment_variables: nil, fleet: nil, privileged: nil) ⇒ BuildEnvironment
constructor
A new instance of BuildEnvironment.
- #to_jsii ⇒ Object
Constructor Details
#initialize(build_image: nil, certificate: nil, compute_type: nil, docker_server: nil, environment_variables: nil, fleet: nil, privileged: nil) ⇒ BuildEnvironment
Returns a new instance of BuildEnvironment.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'code_build/build_environment.rb', line 13 def initialize(build_image: nil, certificate: nil, compute_type: nil, docker_server: nil, environment_variables: nil, fleet: nil, privileged: nil) @build_image = build_image Jsii::Type.check_type(@build_image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklCdWlsZEltYWdlIn0=")), "buildImage") unless @build_image.nil? @certificate = certificate.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironmentCertificate.new(**certificate.transform_keys(&:to_sym)) : certificate Jsii::Type.check_type(@certificate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkRW52aXJvbm1lbnRDZXJ0aWZpY2F0ZSJ9")), "certificate") unless @certificate.nil? @compute_type = compute_type Jsii::Type.check_type(@compute_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkNvbXB1dGVUeXBlIn0=")), "computeType") unless @compute_type.nil? @docker_server = docker_server.is_a?(Hash) ? ::AWSCDK::CodeBuild::DockerServerOptions.new(**docker_server.transform_keys(&:to_sym)) : docker_server Jsii::Type.check_type(@docker_server, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkRvY2tlclNlcnZlck9wdGlvbnMifQ==")), "dockerServer") unless @docker_server.nil? @environment_variables = environment_variables.is_a?(Hash) ? environment_variables.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironmentVariable.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : environment_variables Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQnVpbGRFbnZpcm9ubWVudFZhcmlhYmxlIn0sImtpbmQiOiJtYXAifX0=")), "environmentVariables") unless @environment_variables.nil? @fleet = fleet Jsii::Type.check_type(@fleet, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklGbGVldCJ9")), "fleet") unless @fleet.nil? @privileged = privileged Jsii::Type.check_type(@privileged, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "privileged") unless @privileged.nil? end |
Instance Attribute Details
#build_image ⇒ AWSCDK::CodeBuild::IBuildImage? (readonly)
Default: LinuxBuildImage.STANDARD_7_0
The image used for the builds.
34 35 36 |
# File 'code_build/build_environment.rb', line 34 def build_image @build_image end |
#certificate ⇒ AWSCDK::CodeBuild::BuildEnvironmentCertificate? (readonly)
Default: - No external certificate is added to the project
The location of the PEM-encoded certificate for the build project.
39 40 41 |
# File 'code_build/build_environment.rb', line 39 def certificate @certificate end |
#compute_type ⇒ AWSCDK::CodeBuild::ComputeType? (readonly)
Default: taken from #buildImage#defaultComputeType
The type of compute to use for this build.
See the ComputeType enum for the possible values.
46 47 48 |
# File 'code_build/build_environment.rb', line 46 def compute_type @compute_type end |
#docker_server ⇒ AWSCDK::CodeBuild::DockerServerOptions? (readonly)
Default: - Doesn't use remote docker server
The Docker server configuration CodeBuild use to build your Docker image.
51 52 53 |
# File 'code_build/build_environment.rb', line 51 def docker_server @docker_server end |
#environment_variables ⇒ Hash{String => AWSCDK::CodeBuild::BuildEnvironmentVariable}? (readonly)
The environment variables that your builds can use.
55 56 57 |
# File 'code_build/build_environment.rb', line 55 def environment_variables @environment_variables end |
#fleet ⇒ AWSCDK::CodeBuild::IFleet? (readonly)
Default: - No fleet will be attached to the project, which will remain on-demand.
Fleet resource for a reserved capacity CodeBuild project.
Fleets allow for process builds or tests to run immediately and reduces build durations, by reserving compute resources for your projects.
You will be charged for the resources in the fleet, even if they are idle.
66 67 68 |
# File 'code_build/build_environment.rb', line 66 def fleet @fleet end |
#privileged ⇒ Boolean? (readonly)
Default: false
Indicates how the project builds Docker images.
Specify true to enable running the Docker daemon inside a Docker container. This value must be set to true only if this build project will be used to build Docker images, and the specified build environment image is not one provided by AWS CodeBuild with Docker support. Otherwise, all associated builds that attempt to interact with the Docker daemon will fail.
78 79 80 |
# File 'code_build/build_environment.rb', line 78 def privileged @privileged end |
Class Method Details
.jsii_properties ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 |
# File 'code_build/build_environment.rb', line 80 def self.jsii_properties { :build_image => "buildImage", :certificate => "certificate", :compute_type => "computeType", :docker_server => "dockerServer", :environment_variables => "environmentVariables", :fleet => "fleet", :privileged => "privileged", } end |
Instance Method Details
#to_jsii ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'code_build/build_environment.rb', line 92 def to_jsii result = {} result.merge!({ "buildImage" => @build_image, "certificate" => @certificate, "computeType" => @compute_type, "dockerServer" => @docker_server, "environmentVariables" => @environment_variables, "fleet" => @fleet, "privileged" => @privileged, }) result.compact end |