eycap 0.6.8 → 0.6.9

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.
@@ -1,3 +1,6 @@
1
+ == 0.6.9 / 2013-05-29
2
+ * #43 eycap v0.6.8 fails to detect rvm gem path with rvm-capistrano - Michal Papis.
3
+
1
4
  == 0.6.8 / 2013-05-29
2
5
  * #42 allow custom path for ey binaries - Michal Papis.
3
6
  * Added bundle_config task for bundler - Tyler Bird.
@@ -1,5 +1,6 @@
1
1
  require 'eycap/lib/ey_logger'
2
2
  require 'eycap/lib/ey_logger_hooks'
3
+ require 'eycap/lib/rvm_helper'
3
4
  require 'eycap/recipes/apache'
4
5
  require 'eycap/recipes/backgroundrb'
5
6
  require 'eycap/recipes/bundler'
@@ -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
- parallel do |session|
9
- rvm_role = fetch(:rvm_require_role,"rvm")
10
- if exists?(:rvm_shell)
11
- session.when "in?(:#{rvm_role})", command_with_shell(<<-SHELL.split("\n").map(&:strip).join("; "), fetch(:rvm_shell))
12
- if [ -f #{release_path}/Gemfile ]
13
- then cd #{release_path} && bundle install --without=#{bundle_without} --system
14
- fi
15
- SHELL
16
- end
17
- session.else <<-SHELL.split("\n").map(&:strip).join("; ")
18
- mkdir -p #{shared_path}/bundled_gems
19
- if [ -f #{release_path}/Gemfile ]
20
- then cd #{release_path} && bundle install --without=#{bundle_without} --binstubs #{release_path}/bin --path #{shared_path}/bundled_gems --quiet
21
- fi
22
- if [ ! -h #{release_path}/bin ]
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
- <<-SHELL.split("\n").map(&:strip).join("; ")
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"
@@ -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
- parallel do |session|
14
- rvm_role = fetch(:rvm_require_role,"rvm")
15
- if exists?(:rvm_shell)
16
- session.when "in?(:#{rvm_role})", command_with_shell(<<-SHELL.split("\n").map(&:strip).join("; "), fetch(:rvm_shell))
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"
@@ -1,4 +1,4 @@
1
1
  module Eycap
2
- VERSION = '0.6.8'
2
+ VERSION = '0.6.9'
3
3
  end
4
4
 
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-05-29 00:00:00.000000000 Z
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
- none: false
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
- none: false
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
- none: false
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
- none: false
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: -2005581508759271806
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: -2005581508759271806
158
- version: '0'
159
- none: false
160
+ hash: 3811567187835498791
160
161
  requirements: []
161
162
  rubyforge_project:
162
163
  rubygems_version: 1.8.23