foreplay 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/lib/foreplay/deploy.rb +6 -2
- data/lib/foreplay/setup.rb +1 -1
- data/lib/foreplay/version.rb +1 -1
- data/spec/lib/foreplay/deploy_spec.rb +9 -9
- data/spec/lib/foreplay/setup_spec.rb +1 -1
- 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: 2c3e2f8cd2782d6841948aa40004fcb67b5ef8d9
|
4
|
+
data.tar.gz: d19106d2b46fb6ee029218f83cebbecb8ebba241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73737f31d440c221d87f1faafe4ff4a90bc816275142610111bd4f8eba0aafacd863e0a54c5c91ce7055c281ef8130c54de2745dd42888b0a7e44ccbbd15d66e
|
7
|
+
data.tar.gz: 34b56f5bf72f7c6f523f41d8951a075491cda0d669a59ba06756508f3b60cb17469a71f707656b4453285352661248ade925f0d4fc6d361fe68adb3982950212
|
data/.rubocop.yml
CHANGED
@@ -36,14 +36,14 @@ PerceivedComplexity:
|
|
36
36
|
ClassLength:
|
37
37
|
Description: 'Avoid classes longer than 100 lines of code.'
|
38
38
|
CountComments: false # count full line comments?
|
39
|
-
Max:
|
39
|
+
Max: 295
|
40
40
|
|
41
41
|
Output:
|
42
42
|
Description: 'Checks for calls to puts, print, etc.'
|
43
43
|
Enabled: false
|
44
44
|
|
45
45
|
AbcSize:
|
46
|
-
Max:
|
46
|
+
Max: 62
|
47
47
|
|
48
48
|
ExtraSpacing:
|
49
49
|
Enabled: false
|
data/lib/foreplay/deploy.rb
CHANGED
@@ -205,7 +205,7 @@ module Foreplay
|
|
205
205
|
commentary: 'Setting the current version of bundle to be the default' },
|
206
206
|
{ command: 'bundle install --deployment --clean --jobs 2 --without development test',
|
207
207
|
commentary: 'Using bundler to install the required gems in deployment mode' },
|
208
|
-
{ command: 'mkdir -p ../cache/vendor && rsync -aW --no-compress --delete --info=
|
208
|
+
{ command: 'mkdir -p ../cache/vendor && rsync -aW --no-compress --delete --info=STATS1'\
|
209
209
|
' vendor/bundle/ ../cache/vendor/bundle',
|
210
210
|
commentary: 'Caching bundle' },
|
211
211
|
{ command: 'if [ -f public/assets/manifest.yml ] ; then echo "Not precompiling assets"'\
|
@@ -314,9 +314,13 @@ module Foreplay
|
|
314
314
|
session.close
|
315
315
|
else
|
316
316
|
# Deployment check: just say what we would have done
|
317
|
+
puts "#{server}#{INDENT * 2}Connection options:"
|
318
|
+
options.each { |k, v| puts "#{server}#{INDENT * 2}#{k}: #{v}" }
|
319
|
+
|
320
|
+
puts "#{server}#{INDENT * 2}"
|
321
|
+
puts "#{server}#{INDENT * 2}Deployment instructions:"
|
317
322
|
steps.each do |step|
|
318
323
|
commands = build_step server, step, instructions
|
319
|
-
|
320
324
|
commands.each { |command| puts "#{server}#{INDENT * 2}#{command}" unless step[:silent] }
|
321
325
|
end
|
322
326
|
end
|
data/lib/foreplay/setup.rb
CHANGED
@@ -15,7 +15,7 @@ module Foreplay
|
|
15
15
|
class_option :servers, aliases: '-s', type: :array
|
16
16
|
class_option :db_adapter, aliases: '-a', default: 'postgresql'
|
17
17
|
class_option :db_encoding, aliases: '-e', default: 'utf8'
|
18
|
-
class_option :db_pool,
|
18
|
+
class_option :db_pool, default: 5
|
19
19
|
class_option :db_name, aliases: '-d'
|
20
20
|
class_option :db_host, aliases: '-h'
|
21
21
|
class_option :db_user
|
data/lib/foreplay/version.rb
CHANGED
@@ -22,19 +22,19 @@ describe Foreplay::Deploy do
|
|
22
22
|
allow(process).to receive(:exit_status).and_return(0)
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "complains on check if there's no config file" do
|
26
26
|
`rm -f config/foreplay.yml`
|
27
27
|
expect { Foreplay::Deploy.start([:check, 'production', '']) }
|
28
28
|
.to raise_error(RuntimeError, /.*Please run foreplay setup or create the file manually.*/)
|
29
29
|
end
|
30
30
|
|
31
|
-
it "
|
31
|
+
it "complains on deploy if there's no config file" do
|
32
32
|
`rm -f config/foreplay.yml`
|
33
33
|
expect { Foreplay::Deploy.start([:deploy, 'production', '']) }
|
34
34
|
.to raise_error(RuntimeError, /.*Please run foreplay setup or create the file manually.*/)
|
35
35
|
end
|
36
36
|
|
37
|
-
it '
|
37
|
+
it 'complains if there are no authentication methods defined in the config file' do
|
38
38
|
`rm -f config/foreplay.yml`
|
39
39
|
`foreplay setup -r git@github.com:Xenapto/foreplay.git -s web.example.com -f apps/%a -u fred --password ""`
|
40
40
|
expect { Foreplay::Deploy.start([:deploy, 'production', '']) }
|
@@ -44,7 +44,7 @@ describe Foreplay::Deploy do
|
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
|
-
it "
|
47
|
+
it "complains if the private keyfile defined in the config file doesn't exist" do
|
48
48
|
`rm -f config/foreplay.yml`
|
49
49
|
`foreplay setup -r git@github.com:Xenapto/foreplay.git -s web.example.com -f apps/%a -u fred --keyfile "/home/fred/no-such-file"`
|
50
50
|
expect { Foreplay::Deploy.start([:deploy, 'production', '']) }
|
@@ -69,23 +69,23 @@ describe Foreplay::Deploy do
|
|
69
69
|
)
|
70
70
|
end
|
71
71
|
|
72
|
-
it '
|
72
|
+
it 'terminates if a remote process exits with a non-zero status' do
|
73
73
|
allow(process).to receive(:exit_status).and_return(1)
|
74
74
|
expect { Foreplay::Deploy.start([:deploy, 'production', '']) }.to raise_error(RuntimeError, /.*output message.*/)
|
75
75
|
end
|
76
76
|
|
77
|
-
it "
|
77
|
+
it "terminates if a connection can't be established with the remote server" do
|
78
78
|
allow(Net::SSH).to receive(:start).and_call_original
|
79
79
|
expect { Foreplay::Deploy.start([:deploy, 'production', '']) }
|
80
80
|
.to raise_error(RuntimeError, /.*There was a problem starting an ssh session on web1.example.com.*/)
|
81
81
|
end
|
82
82
|
|
83
|
-
it '
|
83
|
+
it 'checks the config' do
|
84
84
|
expect($stdout).to receive(:puts).at_least(:once)
|
85
85
|
Foreplay::Deploy.start [:check, 'production', '']
|
86
86
|
end
|
87
87
|
|
88
|
-
it '
|
88
|
+
it 'deploys to the environment' do
|
89
89
|
expect(Net::SSH)
|
90
90
|
.to(receive(:start))
|
91
91
|
.with(/web[12].example.com/, 'fred', verbose: :warn, port: 22, password: 'trollope')
|
@@ -117,7 +117,7 @@ describe Foreplay::Deploy do
|
|
117
117
|
' ; else echo No bundle to restore ; fi',
|
118
118
|
'sudo ln -f `which bundle` /usr/bin/bundle || echo Using default version of bundle',
|
119
119
|
'bundle install --deployment --clean --jobs 2 --without development test',
|
120
|
-
'mkdir -p ../cache/vendor && rsync -aW --no-compress --delete --info=
|
120
|
+
'mkdir -p ../cache/vendor && rsync -aW --no-compress --delete --info=STATS1 vendor/bundle/ ../cache/vendor/bundle',
|
121
121
|
'if [ -f public/assets/manifest.yml ] ; then echo "Not precompiling assets"'\
|
122
122
|
' ; else RAILS_ENV=production bundle exec foreman run rake assets:precompile ; fi',
|
123
123
|
'sudo bundle exec foreman export upstart /etc/init',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreplay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xenapto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|