Class: Bosh::Agent::ApplyPlan::Job
- Includes:
- Helpers
- Defined in:
- lib/bosh_agent/apply_plan/job.rb
Defined Under Namespace
Classes: ConfigurationError, InstallationError
Instance Attribute Summary collapse
-
#install_path ⇒ Object
readonly
Returns the value of attribute install_path.
-
#link_path ⇒ Object
readonly
Returns the value of attribute link_path.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #configure(job_index) ⇒ Object
-
#initialize(job_name, template_name, template_spec, config_binding = nil) ⇒ Job
constructor
Initializes a job.
- #install ⇒ Object
- #prepare_for_install ⇒ Object
Constructor Details
#initialize(job_name, template_name, template_spec, config_binding = nil) ⇒ Job
Initializes a job.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 25 def initialize(job_name, template_name, template_spec, config_binding = nil) validate_spec(template_spec) @base_dir = Bosh::Agent::Config.base_dir @name = "#{job_name}.#{template_name}" @template = template_name @version = template_spec['version'] @checksum = template_spec['sha1'] @blobstore_id = template_spec['blobstore_id'] @config_binding = config_binding @install_path = File.join(@base_dir, 'data', 'jobs', @template, @version, @checksum) @link_path = File.join(@base_dir, 'jobs', @template) end |
Instance Attribute Details
#install_path ⇒ Object (readonly)
Returns the value of attribute install_path.
12 13 14 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 12 def install_path @install_path end |
#link_path ⇒ Object (readonly)
Returns the value of attribute link_path.
13 14 15 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 13 def link_path @link_path end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
14 15 16 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 14 def template @template end |
Instance Method Details
#configure(job_index) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 54 def configure(job_index) run_post_install_hook configure_monit(job_index) rescue SystemCallError => e config_failed("system call error: #{e.}") end |
#install ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 46 def install fetch_bits_and_symlink bind_configuration rescue SystemCallError => e install_failed("system call error: #{e.}") end |
#prepare_for_install ⇒ Object
42 43 44 |
# File 'lib/bosh_agent/apply_plan/job.rb', line 42 def prepare_for_install fetch_bits end |