eycap 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/lib/eycap.rb +1 -0
- data/lib/eycap/lib/rvm_helper.rb +27 -0
- data/lib/eycap/recipes/bundler.rb +18 -22
- data/lib/eycap/recipes/rvm.rb +4 -10
- data/lib/eycap/version.rb +1 -1
- metadata +25 -24
data/History.txt
CHANGED
data/lib/eycap.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
|
3
|
+
def reformat_code(code)
|
4
|
+
code.split("\n").map(&:strip).join("; ")
|
5
|
+
end
|
6
|
+
|
7
|
+
# Allow parallel execution of rvm and non rvm commands
|
8
|
+
def run_rvm_or(command_rvm, command_else = "true")
|
9
|
+
parallel do |session|
|
10
|
+
command_else = reformat_code(command_else)
|
11
|
+
if Capistrano.const_defined?(:RvmMethods)
|
12
|
+
# command_with_shell is defined in RvmMethods so rvm/capistrano has to be required first
|
13
|
+
command_rvm = command_with_shell(reformat_code(command_rvm), fetch(:rvm_shell, "bash"))
|
14
|
+
rvm_role = fetch(:rvm_require_role, nil)
|
15
|
+
if rvm_role # mixed
|
16
|
+
session.when "in?(:#{rvm_role})", command_rvm
|
17
|
+
session.else command_else
|
18
|
+
else # only rvm
|
19
|
+
session.else command_rvm
|
20
|
+
end
|
21
|
+
else # no rvm
|
22
|
+
session.else command_else
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -5,32 +5,28 @@ set :bundle_without, "test development" unless exists?(:bundle_without)
|
|
5
5
|
namespace :bundler do
|
6
6
|
desc "Automatically installed your bundled gems if a Gemfile exists"
|
7
7
|
task :bundle_gems, :roles => :app, :except => {:no_bundle => true} do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
then ln -nfs #{release_path}/bin #{release_path}/ey_bundler_binstubs
|
24
|
-
fi
|
25
|
-
SHELL
|
26
|
-
end
|
8
|
+
only_with_rvm = <<-SHELL
|
9
|
+
if [ -f #{release_path}/Gemfile ]
|
10
|
+
then cd #{release_path} && bundle install --without=#{bundle_without} --system
|
11
|
+
fi
|
12
|
+
SHELL
|
13
|
+
only_without_rvm = <<-SHELL
|
14
|
+
mkdir -p #{shared_path}/bundled_gems
|
15
|
+
if [ -f #{release_path}/Gemfile ]
|
16
|
+
then cd #{release_path} && bundle install --without=#{bundle_without} --binstubs #{release_path}/bin --path #{shared_path}/bundled_gems --quiet
|
17
|
+
fi
|
18
|
+
if [ ! -h #{release_path}/bin ]
|
19
|
+
then ln -nfs #{release_path}/bin #{release_path}/ey_bundler_binstubs
|
20
|
+
fi
|
21
|
+
SHELL
|
22
|
+
run_rvm_or only_with_rvm, only_without_rvm
|
27
23
|
end
|
28
|
-
task :bundle_config, :roles => :app, :only => {:no_bundle => true} do
|
29
|
-
|
24
|
+
task :bundle_config, :roles => :app, :only => {:no_bundle => true}, :on_no_matching_servers => :continue do
|
25
|
+
run_rvm_or "true", <<-SHELL
|
30
26
|
bundle config --local BIN /data/#{application}/releases/#{release_path}/bin
|
31
27
|
bundle config --local PATH /data/#{application}/shared/bundled_gems
|
32
28
|
bundle config --local DISABLE_SHARED_GEMS "1"
|
33
|
-
bundle config --local WITHOUT test:development
|
29
|
+
bundle config --local WITHOUT test:development
|
34
30
|
SHELL
|
35
31
|
end
|
36
32
|
after "deploy:symlink_configs","bundler:bundle_gems"
|
data/lib/eycap/recipes/rvm.rb
CHANGED
@@ -10,16 +10,10 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
10
10
|
fi
|
11
11
|
DESC
|
12
12
|
task :create_wrappers, :roles => :app, :except => {:no_bundle => true} do
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
rvm alias create #{application} #{fetch(:rvm_ruby_string,nil)}
|
18
|
-
rvm wrapper #{application} --no-links --all
|
19
|
-
SHELL
|
20
|
-
end
|
21
|
-
session.else "true" # minimal NOOP
|
22
|
-
end
|
13
|
+
run_rvm_or <<-SHELL
|
14
|
+
rvm alias create #{application} #{fetch(:rvm_ruby_string,nil)}
|
15
|
+
rvm wrapper #{application} --no-links --all
|
16
|
+
SHELL
|
23
17
|
end
|
24
18
|
|
25
19
|
after "bundler:bundle_gems","rvm:create_wrappers"
|
data/lib/eycap/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eycap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.9
|
4
5
|
prerelease:
|
5
|
-
version: 0.6.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Engine Yard
|
@@ -21,72 +21,72 @@ authors:
|
|
21
21
|
autorequire:
|
22
22
|
bindir: bin
|
23
23
|
cert_chain: []
|
24
|
-
date: 2013-
|
24
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
25
25
|
dependencies:
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: capistrano
|
28
|
-
type: :runtime
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.2.0
|
34
|
-
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
36
38
|
requirements:
|
37
39
|
- - ! '>='
|
38
40
|
- !ruby/object:Gem::Version
|
39
41
|
version: 2.2.0
|
40
|
-
none: false
|
41
|
-
prerelease: false
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
|
-
type: :development
|
45
44
|
requirement: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
46
|
requirements:
|
47
47
|
- - ! '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
|
-
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
51
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
52
54
|
requirements:
|
53
55
|
- - ! '>='
|
54
56
|
- !ruby/object:Gem::Version
|
55
57
|
version: '0'
|
56
|
-
none: false
|
57
|
-
prerelease: false
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: minitest
|
60
|
-
type: :development
|
61
60
|
requirement: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
|
-
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
67
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
68
70
|
requirements:
|
69
71
|
- - ! '>='
|
70
72
|
- !ruby/object:Gem::Version
|
71
73
|
version: '0'
|
72
|
-
none: false
|
73
|
-
prerelease: false
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: minitest-capistrano
|
76
|
-
type: :development
|
77
76
|
requirement: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
78
|
requirements:
|
79
79
|
- - ! '>='
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
|
-
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
83
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
84
86
|
requirements:
|
85
87
|
- - ! '>='
|
86
88
|
- !ruby/object:Gem::Version
|
87
89
|
version: '0'
|
88
|
-
none: false
|
89
|
-
prerelease: false
|
90
90
|
description: Capistrano recipes for the Engine Yard Managed platform.
|
91
91
|
email:
|
92
92
|
- appsupport@engineyard.com
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/eycap.rb
|
107
107
|
- lib/eycap/lib/ey_logger.rb
|
108
108
|
- lib/eycap/lib/ey_logger_hooks.rb
|
109
|
+
- lib/eycap/lib/rvm_helper.rb
|
109
110
|
- lib/eycap/recipes.rb
|
110
111
|
- lib/eycap/recipes/apache.rb
|
111
112
|
- lib/eycap/recipes/backgroundrb.rb
|
@@ -140,23 +141,23 @@ rdoc_options: []
|
|
140
141
|
require_paths:
|
141
142
|
- lib
|
142
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
143
145
|
requirements:
|
144
146
|
- - ! '>='
|
145
147
|
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
146
149
|
segments:
|
147
150
|
- 0
|
148
|
-
hash:
|
149
|
-
version: '0'
|
150
|
-
none: false
|
151
|
+
hash: 3811567187835498791
|
151
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
152
154
|
requirements:
|
153
155
|
- - ! '>='
|
154
156
|
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
155
158
|
segments:
|
156
159
|
- 0
|
157
|
-
hash:
|
158
|
-
version: '0'
|
159
|
-
none: false
|
160
|
+
hash: 3811567187835498791
|
160
161
|
requirements: []
|
161
162
|
rubyforge_project:
|
162
163
|
rubygems_version: 1.8.23
|