Class: Luban::Deployment::Worker::Base
Constant Summary
Parameters::General::DefaultLubanRootPath
Helpers::Utils::LogLevels
Instance Attribute Summary collapse
#backend
#config
Instance Method Summary
collapse
#parameter
included
#assure, #assure_dirs, #assure_symlink, #capture, #check_pass?, #chmod, #cp, #directory?, #file?, #hardware_name, #host, #hostname, #ln, #match?, #md5_for_file, #md5_matched?, #method_missing, #mkdir, #mv, #now, #os_name, #os_release, #readlink, #render_template, #revision_match?, #rm, #rmdir, #sudo, #symlink?, #upload_by_template, #url_exists?, #user_home
#ask, #default_templates_paths, #fetch, #find_template_file, #load_configuration_file, #primary, #release_roles, #role, #roles, #server, #set, #set_default, #syntax_error?
Constructor Details
#initialize(config:, backend:, **task, &blk) ⇒ Base
Returns a new instance of Base.
13
14
15
16
17
18
19
20
|
# File 'lib/luban/deployment/worker/base.rb', line 13
def initialize(config:, backend:, **task, &blk)
@config = config
@backend = backend
@run_blk = blk
@task = create_task(task)
init
validate
end
|
Instance Attribute Details
#task ⇒ Object
Returns the value of attribute task.
11
12
13
|
# File 'lib/luban/deployment/worker/base.rb', line 11
def task
@task
end
|
Instance Method Details
#dry_run? ⇒ Boolean
23
|
# File 'lib/luban/deployment/worker/base.rb', line 23
def dry_run?; task.opts.dry_run; end
|
#env_name ⇒ Object
28
29
30
|
# File 'lib/luban/deployment/worker/base.rb', line 28
def env_name
@env_name ||= "#{stage}.#{project}/#{application}"
end
|
#force? ⇒ Boolean
22
|
# File 'lib/luban/deployment/worker/base.rb', line 22
def force?; task.opts.force; end
|
#linux? ⇒ Boolean
26
|
# File 'lib/luban/deployment/worker/base.rb', line 26
def linux?; os_name == 'Linux'; end
|
#osx? ⇒ Boolean
25
|
# File 'lib/luban/deployment/worker/base.rb', line 25
def osx?; os_name == 'Darwin'; end
|
#run ⇒ Object
39
40
41
|
# File 'lib/luban/deployment/worker/base.rb', line 39
def run
update_result(__return__: @run_blk ? run_with_block : run_with_command).to_h
end
|
#target_full_name ⇒ Object
33
|
# File 'lib/luban/deployment/worker/base.rb', line 33
def target_full_name; "#{target_name}-#{target_version}"; end
|
#target_major_version ⇒ Object
36
|
# File 'lib/luban/deployment/worker/base.rb', line 36
def target_major_version; task.opts.major_version || target_version; end
|
#target_name ⇒ Object
32
|
# File 'lib/luban/deployment/worker/base.rb', line 32
def target_name; task.opts.name; end
|
#target_patch_level ⇒ Object
37
|
# File 'lib/luban/deployment/worker/base.rb', line 37
def target_patch_level; task.opts.patch_level || ''; end
|
#target_version ⇒ Object
35
|
# File 'lib/luban/deployment/worker/base.rb', line 35
def target_version; task.opts.version; end
|