Class: Build::ProvisionTask
- Defined in:
- lib/build/provision_node.rb
Instance Attribute Summary collapse
-
#build_task ⇒ Object
readonly
Returns the value of attribute build_task.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
-
#public_environments ⇒ Object
readonly
Returns the value of attribute public_environments.
Attributes inherited from Task
Instance Method Summary collapse
-
#initialize(*arguments, **options) ⇒ ProvisionTask
constructor
A new instance of ProvisionTask.
- #local_environment ⇒ Object
- #output_environment ⇒ Object
- #output_environments ⇒ Object
- #provision ⇒ Object
- #update ⇒ Object
Methods inherited from Task
#name, #node_string, #task_class
Constructor Details
#initialize(*arguments, **options) ⇒ ProvisionTask
Returns a new instance of ProvisionTask.
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/build/provision_node.rb', line 74 def initialize(*arguments, **) super @dependencies = [] @environments = [] @public_environments = [] @build_task = nil end |
Instance Attribute Details
#build_task ⇒ Object (readonly)
Returns the value of attribute build_task.
88 89 90 |
# File 'lib/build/provision_node.rb', line 88 def build_task @build_task end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
85 86 87 |
# File 'lib/build/provision_node.rb', line 85 def environments @environments end |
#public_environments ⇒ Object (readonly)
Returns the value of attribute public_environments.
86 87 88 |
# File 'lib/build/provision_node.rb', line 86 def public_environments @public_environments end |
Instance Method Details
#local_environment ⇒ Object
106 107 108 |
# File 'lib/build/provision_node.rb', line 106 def local_environment Build::Environment.combine(@node.environment, *@environments)&.evaluate(name: @node.name).freeze end |
#output_environment ⇒ Object
110 111 112 113 114 |
# File 'lib/build/provision_node.rb', line 110 def output_environment if @build_task @build_task.output_environment.dup(parent: nil) end end |
#output_environments ⇒ Object
116 117 118 119 120 121 122 123 124 |
# File 'lib/build/provision_node.rb', line 116 def output_environments environments = @public_environments.dup if environment = self.output_environment environments << environment end return environments end |
#provision ⇒ Object
90 91 92 |
# File 'lib/build/provision_node.rb', line 90 def provision @node.provision end |
#update ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/build/provision_node.rb', line 94 def update provision.each_dependency do |dependency| @dependencies << invoke(@node.dependency_node_for(dependency)) end if wait_for_children? update_environments! else fail!(DependenciesFailed) end end |