engineyard-serverside 1.5.28.pre10 → 1.5.28.pre11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,5 @@
1
1
  require 'thor'
2
2
  require 'pathname'
3
- require 'tmpdir'
4
3
 
5
4
  module EY
6
5
  module Serverside
@@ -57,7 +56,7 @@ module EY
57
56
  EY::Serverside::LoggedOutput.verbose = options[:verbose]
58
57
  EY::Serverside::LoggedOutput.logfile = File.join(ENV['HOME'], "#{options[:app]}-deploy.log")
59
58
 
60
- propagate
59
+ invoke :propagate
61
60
 
62
61
  EY::Serverside::Deploy.new(config).send(default_task)
63
62
  end
@@ -138,7 +137,7 @@ module EY
138
137
 
139
138
  EY::Serverside::Server.load_all_from_array(assemble_instance_hashes(config))
140
139
 
141
- propagate
140
+ invoke :propagate
142
141
 
143
142
  EY::Serverside::Server.all.each do |server|
144
143
  server.sync_directory app_dir
@@ -184,7 +183,7 @@ module EY
184
183
  config = EY::Serverside::Deploy::Configuration.new(options)
185
184
  EY::Serverside::Server.load_all_from_array(assemble_instance_hashes(config))
186
185
 
187
- propagate
186
+ invoke :propagate
188
187
 
189
188
  EY::Serverside::Deploy.new(config).restart_with_maintenance_page
190
189
  end
@@ -210,17 +209,27 @@ module EY
210
209
  gem_filename = "engineyard-serverside-#{EY::Serverside::VERSION}.gem"
211
210
  local_gem_file = File.join(Gem.dir, 'cache', gem_filename)
212
211
  remote_gem_file = File.join(Dir.tmpdir, gem_filename)
212
+ gem_binary = File.join(Gem.default_bindir, 'gem')
213
213
 
214
214
  servers = EY::Serverside::Server.all.find_all { |server| !server.local? }
215
215
 
216
216
  futures = EY::Serverside::Future.call(servers) do |server|
217
- installed = server.gem?('engineyard-serverside', EY::Serverside::VERSION)
218
- unless installed # doesn't have this exact version
217
+ egrep_escaped_version = EY::Serverside::VERSION.gsub(/\./, '\.')
218
+ # the [,)] is to stop us from looking for e.g. 0.5.1, seeing
219
+ # 0.5.11, and mistakenly thinking 0.5.1 is there
220
+ has_gem_cmd = "#{gem_binary} list engineyard-serverside | grep \"engineyard-serverside\" | egrep -q '#{egrep_escaped_version}[,)]'"
221
+
222
+ if !server.run(has_gem_cmd) # doesn't have this exact version
219
223
  puts "~> Installing engineyard-serverside on #{server.hostname}"
220
224
 
221
- installed = server.install_gem(local_gem_file, remote_gem_file)
225
+ system(Escape.shell_command([
226
+ 'scp', '-i', "#{ENV['HOME']}/.ssh/internal",
227
+ "-o", "StrictHostKeyChecking=no",
228
+ local_gem_file,
229
+ "#{config.user}@#{server.hostname}:#{remote_gem_file}",
230
+ ]))
231
+ server.run("sudo #{gem_binary} install --no-rdoc --no-ri '#{remote_gem_file}'")
222
232
  end
223
- installed
224
233
  end
225
234
 
226
235
  EY::Serverside::Future.success?(futures)
@@ -83,43 +83,12 @@ module EY
83
83
  if local?
84
84
  logged_system(command)
85
85
  else
86
- logged_system(ssh_command + Escape.shell_command(["#{user}@#{hostname}", command]))
86
+ logged_system(ssh_command + " " + Escape.shell_command(["#{user}@#{hostname}", command]))
87
87
  end
88
88
  end
89
89
 
90
90
  def ssh_command
91
- "ssh #{ssh_options} "
92
- end
93
-
94
- def scp_command
95
- "scp #{ssh_options} "
96
- end
97
-
98
- def ssh_options
99
- "-i #{ENV['HOME']}/.ssh/internal -o StrictHostKeyChecking=no -o PasswordAuthentication=no"
100
- end
101
-
102
- #
103
- # check whether a gem is installed in the server
104
- #
105
- def gem?(name, version)
106
- egrep_escaped_version = version.gsub(/\./, '\.')
107
- # the [,)] is to stop us from looking for e.g. 0.5.1, seeing
108
- # 0.5.11, and mistakenly thinking 0.5.1 is there
109
- has_gem_cmd = %Q{#{gem_binary} list #{name} | grep "#{name}" | egrep -q "#{egrep_escaped_version}[,)]"}
110
- run(has_gem_cmd)
111
- end
112
-
113
- #
114
- # copy a local gem to the remove server and install it
115
- #
116
- def install_gem(local_gem_file, remote_gem_file)
117
- logged_system(scp_command + Escape.shell_command([local_gem_file, "#{user}@#{hostname}:#{remote_gem_file}"]))
118
- run("sudo #{gem_binary} install --no-rdoc --no-ri '#{remote_gem_file}'")
119
- end
120
-
121
- def gem_binary
122
- File.join(Gem.default_bindir, 'gem')
91
+ "ssh -i #{ENV['HOME']}/.ssh/internal -o StrictHostKeyChecking=no -o PasswordAuthentication=no"
123
92
  end
124
93
 
125
94
  end
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '1.5.28.pre10'
3
+ VERSION = '1.5.28.pre11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.28.pre10
4
+ version: 1.5.28.pre11
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2159950880 !ruby/object:Gem::Requirement
16
+ requirement: &2154041000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.3.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2159950880
24
+ version_requirements: *2154041000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2159950220 !ruby/object:Gem::Requirement
27
+ requirement: &2154040380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.2.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2159950220
35
+ version_requirements: *2154040380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &2159949640 !ruby/object:Gem::Requirement
38
+ requirement: &2154040000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2159949640
46
+ version_requirements: *2154040000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: timecop
49
- requirement: &2159949180 !ruby/object:Gem::Requirement
49
+ requirement: &2154039380 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2159949180
57
+ version_requirements: *2154039380
58
58
  description:
59
59
  email: cloud@engineyard.com
60
60
  executables: