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

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

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 Package::Worker::Base

#package_bin_path, #package_install_path, #packages_path

Methods included from Service::Worker::Base

#control_file_dir, #control_file_name, #control_file_path, #control_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, #deployment_projects_path, #docker_root_path, #downloads_path, #env_path, #envrc_file, #packages_root_path, #project_path, #releases_root_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

#dockerize, #dockerized?, #env_name, #logrotate_count, #monitor_itself?, #monitorable?

Methods included from Parameters::Base

#parameter

Methods included from Parameters::Docker

#validate_for_docker_cert_path

Methods included from Parameters::Project

#monitor_defined?, #process_monitor_via

Methods included from Parameters::General

#current_uid, #current_user, 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, #with_clean_env

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



47
48
49
# File 'lib/luban/deployment/cli/application/worker.rb', line 47

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

#bundle_executableObject



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

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

#docker_pathObject



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

def docker_path
  @docker_path ||= docker_root_path.join(project, application)
end

#gemfileObject



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

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

#has_gemfile?Boolean

Returns:

  • (Boolean)


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

def has_gemfile?; file?(gemfile); end

#profile_nameObject



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

def profile_name; 'app'; end

#release_pathObject



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

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

#release_tagObject



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

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

#releases_pathObject



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

def releases_path
  @releases_path ||= releases_root_path.join(project, application, 'app')
end

#ruby_bin_pathObject



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

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

#shell_setupObject



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

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