capistrano-base_helper 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capistrano-base_helper"
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Leif Ringstad"]
@@ -24,6 +24,12 @@ Capistrano::Configuration.instance(true).load do
24
24
  _cset :monit_daemon_time, "60"
25
25
  _cset :monit_start_delay, "60"
26
26
 
27
+ _cset :monit_local_monitrc, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../../../templates", "monit")), "monitrc.erb")
28
+ _cset :monit_local_application_conf, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../../../templates", "monit")), "app_include.conf.erb")
29
+
30
+ _cset :monit_remote_monitrc, File.join("/etc","monit","monitrc")
31
+ _cset :monit_remote_application_conf, File.join(fetch(:monit_dir), "monit.conf")
32
+
27
33
  #after "deploy:update", "monit:enable"
28
34
  after "deploy:setup", "monit:setup"
29
35
  before "monit:setup", "monit:main_config"
@@ -53,20 +59,15 @@ Capistrano::Configuration.instance(true).load do
53
59
  run "[ -d #{fetch(:monit_enabled_path)} ] || mkdir -p #{fetch(:monit_enabled_path)}"
54
60
 
55
61
  # create include configuration (used when booting the system)
56
- local_config = File.join(File.expand_path(File.join(File.dirname(__FILE__),"../templates", "monit")), "app_include.conf.erb")
57
- remote_config = File.join(fetch(:monit_dir), "monit.conf")
58
62
 
59
- Capistrano::BaseHelper::generate_and_upload_config(local_config, remote_config)
63
+ Capistrano::BaseHelper::generate_and_upload_config(fetch(:monit_local_application_conf), fetch(:monit_remote_application_conf))
60
64
  end
61
65
 
62
66
  desc "Setup main monit config file (/etc/monit/monitrc)"
63
67
  task :main_config, :roles => [:app, :db, :web] do
64
68
  if Capistrano::CLI.ui.agree("Setup /etc/monit/monitrc ?")
65
69
  # create monitrc file
66
- local_config = File.join(File.expand_path(File.join(File.dirname(__FILE__),"../templates", "monit")), "monitrc.erb")
67
- remote_config = File.join("/etc","monit","monitrc")
68
-
69
- Capistrano::BaseHelper::generate_and_upload_config(local_config, remote_config, true)
70
+ Capistrano::BaseHelper::generate_and_upload_config(fetch(:monit_local_monitrc), fetch(:monit_remote_monitrc), true)
70
71
 
71
72
  commands = []
72
73
  commands << "sudo chmod 700 /etc/monit/monitrc"
@@ -1,8 +1,8 @@
1
1
  Capistrano::Configuration.instance(true).load do
2
2
  _cset :runit_dir, defer { "#{shared_path}/runit" }
3
- _cset :runit_local_run, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../templates")), "runit", "run.erb")
4
- _cset :runit_local_finish, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../templates")), "runit", "finish.erb")
5
- _cset :runit_local_log_run, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../templates")), "runit", "log_run.erb")
3
+ _cset :runit_local_run, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../../../templates")), "runit", "run.erb")
4
+ _cset :runit_local_finish, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../../../templates")), "runit", "finish.erb")
5
+ _cset :runit_local_log_run, File.join(File.expand_path(File.join(File.dirname(__FILE__),"../../../templates")), "runit", "log_run.erb")
6
6
  _cset :runit_remote_run, defer {File.join("/etc", "sv", Capistrano::BaseHelper.user_app_env_path, "run")}
7
7
  _cset :runit_remote_finish, defer {File.join("/etc", "sv", Capistrano::BaseHelper.user_app_env_path, "finish")}
8
8
  _cset :runit_remote_log_run, defer {File.join("/etc", "sv", Capistrano::BaseHelper.user_app_env_path, "log", "run")}
@@ -83,7 +83,7 @@ module Capistrano
83
83
  commands << "sudo chown -R #{c.fetch(:runit_log_user)}:#{c.fetch(:runit_log_group)} '#{File.join("/var", "log", "service", Capistrano::BaseHelper.user_app_env_path, "runit")}'"
84
84
 
85
85
  c.run(commands.join(" && "))
86
- Capistrano::BaseHelper.generate_and_upload_config( Capistrano::BaseHelper::get_capistrano_instance.fetch(:runit_local_log_run), Capistrano::BaseHelper::get_capistrano_instance.fetch(:runit_remote_log_run), true )
86
+ Capistrano::BaseHelper.generate_and_upload_config( c.fetch(:runit_local_log_run), c.fetch(:runit_remote_log_run), true )
87
87
  commands = []
88
88
  commands << "sudo chmod u+x '#{File.join("/etc", "sv", Capistrano::BaseHelper.user_app_env_path, "log", "run")}'"
89
89
  commands << "sudo chmod g+x '#{File.join("/etc", "sv", Capistrano::BaseHelper.user_app_env_path, "log", "run")}'"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-base_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -2573387590493266997
102
+ hash: -2866187985074734245
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  none: false
105
105
  requirements: