foreman-capistrano 0.52.6 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/foreman/capistrano.rb +14 -31
- data/lib/foreman/version.rb +1 -1
- metadata +2 -2
data/lib/foreman/capistrano.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
if defined?(Capistrano)
|
2
2
|
Capistrano::Configuration.instance(:must_exist).load do
|
3
3
|
|
4
|
-
namespace :
|
4
|
+
namespace :deploy do
|
5
5
|
desc <<-DESC
|
6
|
-
Export the Procfile
|
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 :
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
data/lib/foreman/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|