foreplay 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4c4e4ef9917372b4901006e36a215e5bf514f8d
4
- data.tar.gz: 8bfcbbdc5fff86836495c6e3be78ef7eb310b373
3
+ metadata.gz: 40ecad41c642ecdf2e8d7065abd53ecbfbdeff89
4
+ data.tar.gz: 3b799e936ea62c6a037142d03b239cdf1888108e
5
5
  SHA512:
6
- metadata.gz: 43c279b50720c5fa48d703f3bbcdd50a9ba59992f53747bdb18f980ed389eec677d25b7a2e58e56a0a1e1e34b2b023fdfad3f6fffbe988cd3c079fbeb5509b7f
7
- data.tar.gz: adb7c65e9572ca25ee5d51908a3bd6c78d8137f8f1b11b77a1eea1f6d5dd29df22b18204766cd155fc2c9feb21e72151629b45c58455fefaa3c8ed3f7991c0a5
6
+ metadata.gz: dd8f8adc7ca2f3645ae6f6d0fed910524a60343909bd6f97d8ffeaf3d5ef648ca775161625c5ae5011e76e5f60361ce56c4c44ac93da83ad5a9390ce1ac4e9db
7
+ data.tar.gz: 5b718a0c95491f62035a6a3665cb11029ba5e3e03c4f5fc132a85de1141dca528b935d970d49fa77aa83707ed06afda40ec6d8ed20fa01ec8057ec20adb902c3
data/README.md CHANGED
@@ -12,15 +12,12 @@ I noticed with surprise on [RubyGems](https://rubygems.org/gems/foreplay) that m
12
12
  There's now a CLI for the gem so you can use it as follows. To check what it's going to do:
13
13
 
14
14
  foreplay check production
15
-
15
+
16
16
  ...and if you're brave enough to try it for real:
17
17
 
18
18
  foreplay deploy production
19
-
20
- ...after you've set it up by creating a `config/foreplay.yml` file.
21
-
22
- Don't read any further. It's all rubbish below here :-)
23
19
 
20
+ ...after you've set it up by creating a `config/foreplay.yml` file.
24
21
 
25
22
  ## Installation
26
23
 
@@ -36,17 +33,6 @@ Or install it yourself as:
36
33
 
37
34
  $ gem install foreplay
38
35
 
39
- ## Usage
40
-
41
- ENV=production rake foreplay:push
42
-
43
- or
44
-
45
- ENV=production ROLE=web rake foreplay:push
46
-
47
- You can set the environment variables `ENV` and `ROLE` elsewhere if you wish.
48
- If `ROLE` is not defined then we deploy all roles.
49
-
50
36
  ### How it works
51
37
 
52
38
  Foreplay does this:
@@ -199,7 +199,7 @@ module Foreplay
199
199
  end
200
200
 
201
201
  def execute_on_server steps, instructions
202
- server = instructions[:server]
202
+ server_port = instructions[:server]
203
203
  user = instructions[:user]
204
204
  password = instructions[:password]
205
205
  keyfile = instructions[:keyfile]
@@ -207,8 +207,12 @@ module Foreplay
207
207
 
208
208
  keyfile.sub! '~', ENV['HOME'] || '/' unless keyfile.blank? # Remote shell won't expand this for us
209
209
 
210
+ # Parse server + port
211
+ server, port = server_port.split(':')
212
+ port ||= 22
213
+
210
214
  # SSH authentication methods
211
- options = { :verbose => :warn }
215
+ options = { :verbose => :warn, :port => port }
212
216
 
213
217
  if password.blank?
214
218
  # If there's no password we must supply a private key
@@ -231,12 +235,12 @@ module Foreplay
231
235
  output = ''
232
236
 
233
237
  if mode == :deploy
234
- puts "#{INDENT}Connecting to #{server}"
238
+ puts "#{INDENT}Connecting to #{server} on port #{port}"
235
239
 
236
240
  # SSH connection
237
241
  begin
238
242
  Net::SSH.start(server, user, options) do |session|
239
- puts "#{INDENT}Successfully connected to #{server}"
243
+ puts "#{INDENT}Successfully connected to #{server} on port #{port}"
240
244
 
241
245
  session.shell do |sh|
242
246
  steps.each do |step|
@@ -265,7 +269,7 @@ module Foreplay
265
269
  end
266
270
  end
267
271
  rescue SocketError => e
268
- terminate "There was a problem starting an ssh session on #{server}:\n#{e.message}"
272
+ terminate "There was a problem starting an ssh session on #{server_port}:\n#{e.message}"
269
273
  end
270
274
  else
271
275
  # Deployment check: just say what we would have done
@@ -1,3 +1,3 @@
1
1
  module Foreplay
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -60,7 +60,7 @@ describe Foreplay::Deploy do
60
60
  end
61
61
 
62
62
  it "should deploy to the environment" do
63
- Net::SSH.should_receive(:start).with('web.example.com', 'fred', { :verbose => :warn, :password => 'trollope' }).and_yield(session)
63
+ Net::SSH.should_receive(:start).with('web.example.com', 'fred', { :verbose => :warn, :port => 22, :password => 'trollope' }).and_yield(session)
64
64
 
65
65
  [
66
66
  'mkdir -p .foreplay && touch .foreplay/foreplay/current_port && cat .foreplay/foreplay/current_port',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto