capistrano-foreman 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/capistrano-foreman.gemspec +1 -1
- data/lib/capistrano/tasks/foreman.rb +33 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a074314158aaf705130e0fc22a91fe9cd598e70b
|
4
|
+
data.tar.gz: 30cf5f1dc0b200c517247310b4de12a05e800ffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f093dd032f43b9114beeee3939d6fce1dbef4cd33bd9e41ba9be5e8a506d972693ff45766257d96fdca7c7147af76fde745178127e88c787c036ea3c9dc5f2f
|
7
|
+
data.tar.gz: 9f4997e77dd54fc68614c980b9b58ea182f4d3cbfb9e75ed40a9a62b31954d2557a256c3a19e6df0471fad2c3e8a83079129d38f3bbb9270e97a9d2b592cc44b
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ Add this to your `Capfile`:
|
|
14
14
|
require 'capistrano/foreman'
|
15
15
|
|
16
16
|
# Default settings
|
17
|
-
set :foreman_use_sudo, false
|
17
|
+
set :foreman_use_sudo, false # Set to :rbenv for rbenv sudo, :rvm for rvmsudo or true for normal sudo
|
18
18
|
set :foreman_roles, :all
|
19
19
|
set :foreman_template, 'upstart'
|
20
20
|
set :foreman_export_path, File.join(Dir.home, '.init')
|
data/capistrano-foreman.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
15
|
gem.name = "capistrano-foreman"
|
16
16
|
gem.require_paths = ["lib"]
|
17
|
-
gem.version = '1.
|
17
|
+
gem.version = '1.2.0'
|
18
18
|
|
19
19
|
gem.add_dependency 'capistrano', '~> 3.1'
|
20
20
|
gem.add_dependency 'capistrano-bundler', '~> 1.1'
|
@@ -7,16 +7,18 @@ namespace :foreman do
|
|
7
7
|
desc 'Export the Procfile'
|
8
8
|
task :export do
|
9
9
|
on roles fetch(:foreman_roles) do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
opts = {
|
11
|
+
app: fetch(:application),
|
12
|
+
log: File.join(shared_path, 'log'),
|
13
|
+
}.merge fetch(:foreman_options, {})
|
14
|
+
|
15
|
+
execute(:mkdir, "-p", opts[:log])
|
15
16
|
|
16
|
-
|
17
|
+
within release_path do
|
18
|
+
foreman_exec :foreman, 'export',
|
17
19
|
fetch(:foreman_template),
|
18
20
|
fetch(:foreman_export_path),
|
19
|
-
opts.map { |opt, value| "--#{opt}
|
21
|
+
opts.map { |opt, value| "--#{opt}=\"#{value}\"" }.join(' ')
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -24,31 +26,51 @@ namespace :foreman do
|
|
24
26
|
desc 'Start the application services'
|
25
27
|
task :start do
|
26
28
|
on roles fetch(:foreman_roles) do
|
27
|
-
|
29
|
+
foreman_exec :start, fetch(:foreman_app)
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
desc 'Stop the application services'
|
32
34
|
task :stop do
|
33
35
|
on roles fetch(:foreman_roles) do
|
34
|
-
|
36
|
+
foreman_exec :stop, fetch(:foreman_app)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
38
40
|
desc 'Restart the application services'
|
39
41
|
task :restart do
|
40
42
|
on roles fetch(:foreman_roles) do
|
41
|
-
|
43
|
+
foreman_exec :restart, fetch(:foreman_app)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def foreman_exec(*args)
|
48
|
+
sudo_type = fetch(:foreman_use_sudo)
|
49
|
+
case sudo_type.to_s
|
50
|
+
when 'rbenv'
|
51
|
+
# this is required because 'rbenv sudo'
|
52
|
+
# is not recognized by bundle_bins
|
53
|
+
args.unshift(:bundle, :exec) if args[0].to_s == "foreman"
|
54
|
+
execute(:rbenv, :sudo, *args)
|
55
|
+
when 'rvm'
|
56
|
+
execute(:rvmsudo, *args)
|
57
|
+
else
|
58
|
+
sudo_type ? sudo(*args) : execute(*args)
|
42
59
|
end
|
43
60
|
end
|
44
61
|
end
|
45
62
|
|
46
63
|
namespace :load do
|
47
64
|
task :defaults do
|
48
|
-
set :bundle_bins, fetch(:bundle_bins, []).push(
|
65
|
+
set :bundle_bins, fetch(:bundle_bins, []).push(:foreman)
|
66
|
+
set :foreman_use_sudo, false
|
49
67
|
set :foreman_template, 'upstart'
|
50
68
|
set :foreman_export_path, '/etc/init/sites'
|
51
69
|
set :foreman_roles, :all
|
52
70
|
set :foreman_app, -> { fetch(:application) }
|
71
|
+
|
72
|
+
if !fetch(:rvm_map_bins).nil?
|
73
|
+
set :rvm_map_bins, fetch(:rvm_map_bins).push('foreman')
|
74
|
+
end
|
53
75
|
end
|
54
76
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Gorset
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|