foreplay 0.15.2 → 0.15.4
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile +1 -1
- data/README.md +1 -0
- data/lib/foreplay.rb +9 -9
- data/lib/foreplay/engine/defaults.rb +2 -2
- data/lib/foreplay/engine/logger.rb +3 -3
- data/lib/foreplay/engine/port.rb +1 -1
- data/lib/foreplay/engine/remote/check.rb +1 -1
- data/lib/foreplay/engine/remote/step.rb +1 -1
- data/lib/foreplay/engine/step.rb +1 -1
- data/lib/foreplay/engine/steps.yml +1 -1
- data/lib/foreplay/version.rb +1 -1
- data/spec/lib/foreplay/deploy_spec.rb +1 -1
- data/spec/lib/yaml_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3758e074daab2a595d32666e7eb7034efd7eaff2
|
|
4
|
+
data.tar.gz: a40d78f7cbb448bcf8eba79e1b69904f866ac6bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc871cf10d5eec20ae4d665c68b4b7fd64db402a32edc6d2de71aa453b8adbd14a4eefe15ca021a72ba59d2b8ae4839f84c3c508d89cb51881b86d4f86031670
|
|
7
|
+
data.tar.gz: 745f3bf9544292a942718e600ee1a8c12c7caa248a4f86d8e58cfd0b288c19daf913c5d8dffcfbde02afd43297e1e62eccd0eae36e701919c56f33fa94069c31
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Foreplay
|
|
2
2
|
|
|
3
3
|
 [](https://codeclimate.com/github/Xenapto/foreplay) [](https://coveralls.io/r/Xenapto/foreplay?branch=develop)
|
|
4
|
+
[](https://dependencyci.com/github/Xenapto/foreplay)
|
|
4
5
|
[](http://xenapto.com)
|
|
5
6
|
 [](https://gitter.im/Xenapto/foreplay?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
6
7
|
|
data/lib/foreplay.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Foreplay
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def terminate(message)
|
|
15
|
-
|
|
15
|
+
raise message
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -28,20 +28,20 @@ class Hash
|
|
|
28
28
|
# h1.supermerge(h2)
|
|
29
29
|
# #=> {:x=>{:y=>[4, 5, 6, 7, 8, 9]}, :z=>[7, 8, 9, "xyz"]}
|
|
30
30
|
def supermerge(other_hash)
|
|
31
|
-
|
|
31
|
+
raise "supermerge needs a Hash, not a #{other_hash.class}." unless other_hash.is_a?(Hash)
|
|
32
32
|
|
|
33
33
|
new_hash = deep_dup
|
|
34
34
|
|
|
35
35
|
other_hash.each_pair do |k, v|
|
|
36
36
|
tv = new_hash[k]
|
|
37
37
|
|
|
38
|
-
if tv.is_a?(Hash) && v.is_a?(Hash)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
new_hash[k] = if tv.is_a?(Hash) && v.is_a?(Hash)
|
|
39
|
+
tv.supermerge(v)
|
|
40
|
+
elsif tv.is_a?(Array) || v.is_a?(Array)
|
|
41
|
+
Array.wrap(tv) + Array.wrap(v)
|
|
42
|
+
else
|
|
43
|
+
v
|
|
44
|
+
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
new_hash
|
|
@@ -3,8 +3,8 @@ module Foreplay
|
|
|
3
3
|
module Defaults
|
|
4
4
|
include Foreplay
|
|
5
5
|
|
|
6
|
-
DEFAULT_CONFIG_FILE = "#{Dir.getwd}/config/foreplay.yml"
|
|
7
|
-
DEFAULTS_KEY = 'defaults'
|
|
6
|
+
DEFAULT_CONFIG_FILE = "#{Dir.getwd}/config/foreplay.yml".freeze
|
|
7
|
+
DEFAULTS_KEY = 'defaults'.freeze
|
|
8
8
|
|
|
9
9
|
def defaults
|
|
10
10
|
return @defaults if @defaults
|
|
@@ -19,9 +19,9 @@ module Foreplay
|
|
|
19
19
|
|
|
20
20
|
def formatted_message
|
|
21
21
|
@formatted_message ||= header + message
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
.gsub(/\A\s+/, '')
|
|
23
|
+
.gsub(/\s+\z/, '')
|
|
24
|
+
.gsub(/(\r\n|\r|\n)/, "\n#{margin}")
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def header
|
data/lib/foreplay/engine/port.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Foreplay
|
|
|
13
13
|
|
|
14
14
|
def perform
|
|
15
15
|
steps.each do |step|
|
|
16
|
-
log
|
|
16
|
+
log (step['commentary'] || step['command']).yellow.to_s, host: host, silent: step['silent']
|
|
17
17
|
|
|
18
18
|
if step.key? 'key'
|
|
19
19
|
list_file_contents step['key']
|
|
@@ -23,7 +23,7 @@ module Foreplay
|
|
|
23
23
|
process = shell.execute command
|
|
24
24
|
process.on_output { |_, po| o += po }
|
|
25
25
|
shell.wait!
|
|
26
|
-
terminate(o) unless step['ignore_error'] == true || process.exit_status
|
|
26
|
+
terminate(o) unless step['ignore_error'] == true || process.exit_status.zero?
|
|
27
27
|
o
|
|
28
28
|
end
|
|
29
29
|
|
data/lib/foreplay/engine/step.rb
CHANGED
|
@@ -114,7 +114,7 @@ module Foreplay
|
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
def announce
|
|
117
|
-
log
|
|
117
|
+
log (step['commentary'] || command).yellow.to_s, host: host, silent: silent?
|
|
118
118
|
log command.cyan, host: host, silent: silent? if instructions['verbose'] && step['commentary'] && command
|
|
119
119
|
end
|
|
120
120
|
end
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
commentary: 'Updating the bundler version'
|
|
53
53
|
- command: 'sudo ln -f `which bundle` /usr/bin/bundle || echo Using default version of bundle'
|
|
54
54
|
commentary: 'Setting the current version of bundle to be the default'
|
|
55
|
-
- command: '/usr/bin/bundle install --deployment --clean --jobs 2 --without development test'
|
|
55
|
+
- command: '/usr/bin/bundle install --deployment --clean --full-index --jobs 2 --without development test'
|
|
56
56
|
commentary: 'Using bundler to install the required gems in deployment mode'
|
|
57
57
|
- command: 'mkdir -p ../cache/vendor && rsync -aW --no-compress --delete --info=STATS1 vendor/bundle/ ../cache/vendor/bundle'
|
|
58
58
|
commentary: 'Caching bundle'
|
data/lib/foreplay/version.rb
CHANGED
|
@@ -173,7 +173,7 @@ describe Foreplay::Launcher do
|
|
|
173
173
|
' ; else echo No bundle to restore ; fi',
|
|
174
174
|
'gem install bundler -v "> 1.8"',
|
|
175
175
|
'sudo ln -f `which bundle` /usr/bin/bundle || echo Using default version of bundle',
|
|
176
|
-
'/usr/bin/bundle install --deployment --clean --jobs 2 --without development test',
|
|
176
|
+
'/usr/bin/bundle install --deployment --clean --full-index --jobs 2 --without development test',
|
|
177
177
|
'mkdir -p ../cache/vendor && '\
|
|
178
178
|
'rsync -aW --no-compress --delete --info=STATS1 vendor/bundle/ ../cache/vendor/bundle',
|
|
179
179
|
'if [ -f public/assets/manifest.yml ] ; then echo "Not precompiling assets"'\
|
data/spec/lib/yaml_spec.rb
CHANGED
|
@@ -9,12 +9,12 @@ describe YAML do
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
it 'correctly escape a basic string' do
|
|
12
|
-
expect(YAML.escape
|
|
12
|
+
expect(YAML.escape('brian')).to eq('brian')
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
it 'correctly escape a troublesome string' do
|
|
16
|
-
expect(YAML.escape
|
|
17
|
-
expect(YAML.escape
|
|
16
|
+
expect(YAML.escape('{{moustache}} beard')).to eq('"{{moustache}} beard"')
|
|
17
|
+
expect(YAML.escape("Brian O'Brien")).to eq("Brian O'Brien")
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
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.15.
|
|
4
|
+
version: 0.15.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Xenapto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: foreman
|
|
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
368
368
|
version: '0'
|
|
369
369
|
requirements: []
|
|
370
370
|
rubyforge_project:
|
|
371
|
-
rubygems_version: 2.6.
|
|
371
|
+
rubygems_version: 2.6.7
|
|
372
372
|
signing_key:
|
|
373
373
|
specification_version: 4
|
|
374
374
|
summary: 'Example: foreplay deploy production'
|