foreman-capistrano 0.52.6 → 0.53.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  if defined?(Capistrano)
2
2
  Capistrano::Configuration.instance(:must_exist).load do
3
3
 
4
- namespace :foreman do
4
+ namespace :deploy do
5
5
  desc <<-DESC
6
- Export the Procfile to upstart. Will use sudo if available.
6
+ Export the Procfile and restart application.
7
7
 
8
8
  You can override any of these defaults by setting the variables shown below.
9
9
 
@@ -15,7 +15,7 @@ if defined?(Capistrano)
15
15
  set :foreman_log, "\#{shared_path}/log"
16
16
  set :foreman_concurrency, false
17
17
  DESC
18
- task :export, :roles => :app do
18
+ task :restart, :roles => :web, :max_hosts => 1 do
19
19
  bundle_cmd = fetch(:bundle_cmd, "bundle")
20
20
  foreman_format = fetch(:foreman_format, "upstart")
21
21
  foreman_location = fetch(:foreman_location, "/etc/init")
@@ -33,34 +33,17 @@ if defined?(Capistrano)
33
33
  args << "-l #{foreman_log}"
34
34
  args << "-p #{foreman_port}"
35
35
  args << "-c #{foreman_concurrency}" if foreman_concurrency
36
- run "cd #{current_path} && #{bundle_cmd} exec foreman export #{args.join(' ')}"
37
- end
38
-
39
- desc "Start the application services"
40
- task :start, :roles => :app do
41
- if fetch(:foreman_format, "upstart") == 'upstart'
42
- run "#{sudo} start #{application}"
43
- elsif fetch(:foreman_format, "upstart") == 'monit'
44
- run "monit start -g #{application}"
45
- end
46
- end
47
-
48
- desc "Stop the application services"
49
- task :stop, :roles => :app do
50
- if fetch(:foreman_format, "upstart") == 'upstart'
51
- run "#{sudo} stop #{application}"
52
- elsif fetch(:foreman_format, "upstart") == 'monit'
53
- run "monit stop -g #{application}"
54
- end
55
- end
56
-
57
- desc "Restart the application services"
58
- task :restart, :roles => :app do
59
- if fetch(:foreman_format, "upstart") == 'upstart'
60
- run "#{sudo} start #{application} || #{sudo} restart #{application}"
61
- elsif fetch(:foreman_format, "upstart") == 'monit'
62
- run "monit reload; sleep 1; monit restart -g #{application}"
63
- end
36
+ export_cmd = "cd #{current_path} && #{bundle_cmd} exec foreman export #{args.join(' ')}"
37
+ run ["sudo /etc/init.d/puppet stop",
38
+ "sudo /etc/init.d/monit stop",
39
+ "sudo /etc/init.d/nginx stop",
40
+ "monit stop -g #{application}",
41
+ export_cmd,
42
+ "monit start -g #{application}",
43
+ "sleep 20",
44
+ "sudo /etc/init.d/nginx start",
45
+ "sudo /etc/init.d/monit start",
46
+ "sudo /etc/init.d/puppet start"].join('; ')
64
47
  end
65
48
  end
66
49
  end
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.52.6"
3
+ VERSION = "0.53.0"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.52.6
4
+ version: 0.53.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor