Class: Bosh::Director::DeploymentPlan::CompilationConfig
- Includes:
- ValidationHelper
- Defined in:
- lib/bosh/director/deployment_plan/compilation_config.rb
Overview
Represents the deployment compilation worker configuration.
Instance Attribute Summary collapse
-
#cloud_properties ⇒ Hash
Cloud properties to use when creating VMs.
-
#deployment ⇒ DeploymentPlan
Associated deployment.
-
#env ⇒ Hash
Environment to use when creating VMs.
-
#network ⇒ DeploymentPlan::Network
Network used by compilation workers.
-
#reuse_compilation_vms ⇒ Bool
If VMs should be reused for compilation tasks.
-
#workers ⇒ Integer
Number of worker VMs to use.
Instance Method Summary collapse
-
#initialize(deployment, compilation_config) ⇒ CompilationConfig
constructor
Creates compilation configuration spec from the deployment manifest.
Methods included from ValidationHelper
Constructor Details
#initialize(deployment, compilation_config) ⇒ CompilationConfig
Creates compilation configuration spec from the deployment manifest.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 31 def initialize(deployment, compilation_config) @deployment = deployment @workers = safe_property(compilation_config, "workers", :class => Integer, :min => 1) network_name = safe_property(compilation_config, "network", :class => String) @reuse_compilation_vms = safe_property(compilation_config, "reuse_compilation_vms", :class => :boolean, :optional => true) @network = deployment.network(network_name) if @network.nil? raise CompilationConfigUnknownNetwork, "Compilation config references an unknown " + "network `#{network_name}'" end @cloud_properties = safe_property( compilation_config, "cloud_properties", :class => Hash) @env = safe_property(compilation_config, "env", :class => Hash, :optional => true, :default => {}) end |
Instance Attribute Details
#cloud_properties ⇒ Hash
Returns cloud properties to use when creating VMs. (optional).
20 21 22 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 20 def cloud_properties @cloud_properties end |
#deployment ⇒ DeploymentPlan
Returns associated deployment.
11 12 13 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 11 def deployment @deployment end |
#env ⇒ Hash
Returns environment to use when creating VMs. (optional).
23 24 25 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 23 def env @env end |
#network ⇒ DeploymentPlan::Network
Returns network used by compilation workers.
17 18 19 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 17 def network @network end |
#reuse_compilation_vms ⇒ Bool
Returns if VMs should be reused for compilation tasks. (optional).
26 27 28 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 26 def reuse_compilation_vms @reuse_compilation_vms end |
#workers ⇒ Integer
Returns number of worker VMs to use.
14 15 16 |
# File 'lib/bosh/director/deployment_plan/compilation_config.rb', line 14 def workers @workers end |