Class: Capistrano::GoodJob

Inherits:
Plugin
  • Object
show all
Includes:
PumaCommon
Defined in:
lib/capistrano/good_job.rb

Instance Method Summary collapse

Instance Method Details

#define_tasks ⇒ Object



13
14
15
# File 'lib/capistrano/good_job.rb', line 13

def define_tasks
  eval_rakefile File.expand_path("../tasks/good_job.rake", __FILE__)
end

#execute_systemd(*args) ⇒ Object



21
22
23
24
# File 'lib/capistrano/good_job.rb', line 21

def execute_systemd(*args)
  command = ["/bin/systemctl", "--user"] + args
  backend.execute(*command)
end

#register_hooks ⇒ Object



17
18
19
# File 'lib/capistrano/good_job.rb', line 17

def register_hooks
  after "deploy:finished", "good_job:restart"
end

#set_defaults ⇒ Object



5
6
7
8
9
10
11
# File 'lib/capistrano/good_job.rb', line 5

def set_defaults
  set_if_empty :good_job_role, "db"
  set_if_empty :good_job_access_log, -> { File.join(shared_path, "log", "good_job.log") }
  set_if_empty :good_job_error_log, -> { File.join(shared_path, "log", "good_job.log") }
  set_if_empty :good_job_service_unit_name, -> { "#{fetch(:application)}_good_job_#{fetch(:stage)}" }
  set_if_empty :good_job_systemd_conf_dir, -> { File.join("/home/#{fetch(:user)}", ".config", "systemd", "user") }
end