Class: Luban::Deployment::Application::Worker

Inherits:
Worker::Base
  • Object
show all
Includes:
Service::Worker::Base, Worker::Paths::Remote
Defined in:
lib/luban/deployment/cli/application/worker.rb

Direct Known Subclasses

Configurator, Constructor, Controller, Publisher

Constant Summary

Constants included from Parameters::General

Parameters::General::DefaultLubanRootPath

Constants included from Helpers::Utils

Helpers::Utils::LogLevels

Instance Attribute Summary

Attributes inherited from Worker::Base

#task

Attributes included from Helpers::Utils

#backend

Attributes included from Helpers::Configuration

#config

Instance Method Summary collapse

Methods included from Service::Worker::Base

#compose_command, #control_file_name, #control_file_path, #log_file_name, #log_file_path, #log_path, #logrotate_file_name, #logrotate_file_path, #pid_file_name, #pid_file_path, #pids_path, #profile_path

Methods included from Worker::Paths::Remote

#app_bin_path, #app_path, #app_tmp_path, #current_app_path, #downloads_path, #env_path, #envrc_file, #etc_path, #logrotate_path, #luban_install_path, #project_path, #shared_path, #tmp_path, #unset_envrc_file

Methods inherited from Worker::Base

#dry_run?, #env_name, #force?, #initialize, #linux?, #osx?, #run, #target_full_name, #target_major_version, #target_name, #target_patch_level, #target_version

Methods included from Parameters::Base

#parameter

Methods included from Parameters::General

included

Methods included from Helpers::Utils

#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

Methods included from Helpers::Configuration

#ask, #default_templates_paths, #fetch, #find_template_file, #load_configuration_file, #primary, #release_roles, #role, #roles, #server, #set, #set_default, #syntax_error?

Constructor Details

This class inherits a constructor from Luban::Deployment::Worker::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Luban::Deployment::Helpers::Utils

Instance Method Details

#package_bin_path(package_name) ⇒ Object



25
26
27
# File 'lib/luban/deployment/cli/application/worker.rb', line 25

def package_bin_path(package_name)
  @package_bin_path ||= package_path(package_name).join('bin')
end

#package_path(package_name) ⇒ Object



20
21
22
23
# File 'lib/luban/deployment/cli/application/worker.rb', line 20

def package_path(package_name)
  @package_path ||= luban_install_path.join('pkg', package_name.to_s, 'versions', 
                                            package_version(package_name))
end

#package_version(package_name) ⇒ Object



18
# File 'lib/luban/deployment/cli/application/worker.rb', line 18

def package_version(package_name); packages[package_name.to_sym].current_version; end

#packagesObject



16
# File 'lib/luban/deployment/cli/application/worker.rb', line 16

def packages; task.opts.packages; end

#release_pathObject



39
40
41
# File 'lib/luban/deployment/cli/application/worker.rb', line 39

def release_path
  @release_path ||= releases_path.join(release_tag)
end

#release_tagObject



33
# File 'lib/luban/deployment/cli/application/worker.rb', line 33

def release_tag; task.opts.release[:tag]; end

#releases_pathObject



35
36
37
# File 'lib/luban/deployment/cli/application/worker.rb', line 35

def releases_path
  @releases_path ||= super.join('app')
end

#service_entryObject



29
30
31
# File 'lib/luban/deployment/cli/application/worker.rb', line 29

def service_entry
  @service_entry ||= "#{env_name.gsub('/', '.')}.app"
end

#shell_setup_commandsObject



8
9
10
# File 'lib/luban/deployment/cli/application/worker.rb', line 8

def shell_setup_commands
  super << "cd #{release_path}"
end