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, Crontab, Publisher

Constant Summary

Constants included from Parameters::Application

Parameters::Application::DefaultLogrotateInterval, Parameters::Application::DefaultLogrotateMaxAge

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

#control_file_name, #control_file_path, #log_file_name, #log_file_path, #log_path, #output_redirection, #pid_file_name, #pid_file_path, #pids_path, #profile_path, #service_entry, #shell_command, #shell_delimiter, #shell_output, #shell_prefix

Methods included from Worker::Paths::Remote

#app_archives_path, #app_bin_path, #app_path, #app_tmp_path, #archived_logs_path, #archives_path, #current_app_path, #downloads_path, #env_path, #envrc_file, #luban_install_path, #package_bin_path, #package_install_path, #project_path, #shared_path, #tmp_path, #unset_envrc_file

Methods inherited from Worker::Base

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

Methods included from Parameters::Application

#env_name, #logrotate_count, #monitor_itself?, #monitorable?

Methods included from Parameters::Base

#parameter

Methods included from Parameters::Project

#monitor_defined?, #process_monitor_via

Methods included from Parameters::General

included

Methods included from Helpers::Utils

#assure, #assure_dirs, #assure_symlink, #capture, #check_pass?, #chmod, #cp, #directory?, #exists?, #file?, #hardware_name, #host, #hostname, #ln, #match?, #md5_for, #md5_for_dir, #md5_for_file, #md5_matched?, #mkdir, #mv, #now, #os_name, #os_release, #readlink, #render_template, #revision_match?, #rm, #rmdir, #sudo, #symlink?, #touch, #truncate, #upload_by_template, #url_exists?, #user_home

Methods included from Helpers::Configuration

#ask, #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::Worker::Base

Instance Method Details

#bundle_command(cmd, **opts) ⇒ Object



42
43
44
# File 'lib/luban/deployment/cli/application/worker.rb', line 42

def bundle_command(cmd, **opts)
  shell_command("#{bundle_executable} exec #{cmd}", **opts)
end

#bundle_executableObject



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

def bundle_executable
  @bundle_executable ||= ruby_bin_path.join('bundle')
end

#gemfileObject



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

def gemfile
  @gemfile ||= release_path.join('Gemfile')
end

#has_gemfile?Boolean

Returns:

  • (Boolean)


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

def has_gemfile?; file?(gemfile); end

#profile_nameObject



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

def profile_name; 'app'; end

#release_pathObject



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

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

#release_tagObject



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

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

#releases_pathObject



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

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

#ruby_bin_pathObject



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

def ruby_bin_path
  @ruby_bin_path ||= package_bin_path('ruby')
end

#shell_setupObject



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

def shell_setup
  @shell_setup ||= super << "cd #{release_path}"
end