geordi 1.9.0 → 1.9.1
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/Gemfile.lock +1 -1
- data/lib/geordi/cli.rb +0 -4
- data/lib/geordi/commands/create_databases.rb +1 -1
- data/lib/geordi/commands/delete_dumps.rb +1 -1
- data/lib/geordi/commands/deploy.rb +2 -3
- data/lib/geordi/commands/migrate.rb +1 -1
- data/lib/geordi/commands/rspec.rb +2 -2
- data/lib/geordi/commands/security_update.rb +9 -8
- data/lib/geordi/commands/with_rake.rb +1 -1
- data/lib/geordi/util.rb +10 -1
- data/lib/geordi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b58c675d81b07400a5d816bc1191ef4ea26a010395379a3e1e103130fa0edd14
|
|
4
|
+
data.tar.gz: 85a7a4a397ed51b174468b1a9f8005d9dec37a2e35ab2c765b41eb01ddbf6052
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aebd6912385505c157d89cda5d81f78e2f35fc172e081690832b824d4d162745c4c415b1b28fc100a0aad83623d6c91e5bbcc87f7613e3079d2260d16e0ca591
|
|
7
|
+
data.tar.gz: 9afd1e6b056e881fc7ad0ee13182d72ee3bb35ca34672935183a225efe850f1a42ac090df9f45722ec062d4d212a926e93cba5964ab704b1903e6c6c743339e5
|
data/Gemfile.lock
CHANGED
data/lib/geordi/cli.rb
CHANGED
|
@@ -14,10 +14,6 @@ module Geordi
|
|
|
14
14
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
|
-
def file_containing?(file, regex)
|
|
18
|
-
File.exists?(file) and File.read(file).scan(regex).any?
|
|
19
|
-
end
|
|
20
|
-
|
|
21
17
|
# fix weird implementation of #invoke
|
|
22
18
|
def invoke_cmd(name, *args)
|
|
23
19
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
|
@@ -7,7 +7,7 @@ def create_databases
|
|
|
7
7
|
|
|
8
8
|
if File.exists?('config/database.yml')
|
|
9
9
|
command = 'bundle exec rake db:create:all'
|
|
10
|
-
command << ' parallel:create' if file_containing?('Gemfile', /parallel_tests/)
|
|
10
|
+
command << ' parallel:create' if Util.file_containing?('Gemfile', /parallel_tests/)
|
|
11
11
|
|
|
12
12
|
Util.system! command
|
|
13
13
|
else
|
|
@@ -68,10 +68,9 @@ def deploy(target_stage = nil)
|
|
|
68
68
|
note "Deploy to #{target_stage}"
|
|
69
69
|
|
|
70
70
|
if prompt('Go ahead with the deployment?', 'n', /y|yes/)
|
|
71
|
-
cap3 = file_containing?('Capfile', 'capistrano/setup')
|
|
72
71
|
capistrano_call = "cap #{target_stage} deploy"
|
|
73
|
-
capistrano_call << ':migrations' unless
|
|
74
|
-
capistrano_call = "bundle exec #{capistrano_call}" if file_containing?('Gemfile', /capistrano/)
|
|
72
|
+
capistrano_call << ':migrations' unless Util.capistrano3? || options.no_migrations
|
|
73
|
+
capistrano_call = "bundle exec #{capistrano_call}" if Util.file_containing?('Gemfile', /capistrano/)
|
|
75
74
|
|
|
76
75
|
invoke_cmd 'bundle_install'
|
|
77
76
|
|
|
@@ -12,7 +12,7 @@ def rspec(*files)
|
|
|
12
12
|
|
|
13
13
|
announce 'Running specs'
|
|
14
14
|
|
|
15
|
-
if file_containing?('Gemfile', /parallel_tests/) and files.empty?
|
|
15
|
+
if Util.file_containing?('Gemfile', /parallel_tests/) and files.empty?
|
|
16
16
|
note 'All specs at once (using parallel_tests)'
|
|
17
17
|
Util.system! 'bundle exec rake parallel:spec', :fail_message => 'Specs failed.'
|
|
18
18
|
|
|
@@ -28,7 +28,7 @@ def rspec(*files)
|
|
|
28
28
|
command = ['bundle exec']
|
|
29
29
|
# differentiate RSpec 1/2
|
|
30
30
|
command << (File.exists?('script/spec') ? 'spec -c' : 'rspec')
|
|
31
|
-
command << '-r rspec_spinner -f RspecSpinner::Bar' if file_containing?('Gemfile', /rspec_spinner/)
|
|
31
|
+
command << '-r rspec_spinner -f RspecSpinner::Bar' if Util.file_containing?('Gemfile', /rspec_spinner/)
|
|
32
32
|
command << files.join(' ')
|
|
33
33
|
|
|
34
34
|
puts
|
|
@@ -21,20 +21,19 @@ def security_update(step='prepare')
|
|
|
21
21
|
|
|
22
22
|
success 'Successfully prepared for security update'
|
|
23
23
|
puts
|
|
24
|
-
note 'Please apply the security update now.'
|
|
24
|
+
note 'Please apply the security update now and commit your changes.'
|
|
25
25
|
note 'When you are done, run `geordi security-update finish`.'
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
when 'finish'
|
|
29
|
-
announce 'Finishing security update'
|
|
30
|
-
|
|
28
|
+
when 'f', 'finish'
|
|
31
29
|
# ensure everything is committed
|
|
32
|
-
`git status --porcelain`.empty? or fail('
|
|
33
|
-
note 'Working directory clean.'
|
|
30
|
+
`git status --porcelain`.empty? or fail('Please commit your changes before finishing the update.')
|
|
34
31
|
|
|
32
|
+
announce 'Finishing security update'
|
|
33
|
+
note 'Working directory clean.'
|
|
35
34
|
prompt('Have you successfully run all tests?', 'n', /y|yes/) or fail 'Please run tests first.'
|
|
36
35
|
|
|
37
|
-
note 'About to: push production, checkout & pull master, merge production, push master
|
|
36
|
+
note 'About to: push production, checkout & pull master, merge production, push master'
|
|
38
37
|
prompt('Continue?', 'n', /y|yes/) or fail 'Cancelled.'
|
|
39
38
|
|
|
40
39
|
Util.system! 'git push', :show_cmd => true
|
|
@@ -43,7 +42,9 @@ def security_update(step='prepare')
|
|
|
43
42
|
Util.system! 'git merge production', :show_cmd => true
|
|
44
43
|
Util.system! 'git push', :show_cmd => true
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
announce 'Deploying all targets'
|
|
46
|
+
deploy = Util.capistrano3? ? 'deploy' : 'deploy:migrations'
|
|
47
|
+
invoke_cmd 'capistrano', deploy
|
|
47
48
|
|
|
48
49
|
success 'Successfully pushed and deployed security update'
|
|
49
50
|
puts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
desc 'with-rake', 'Run tests with `rake`', :hide => true
|
|
2
2
|
def with_rake
|
|
3
|
-
if file_containing?('Rakefile', /^task.+default.+(spec|test|feature)/)
|
|
3
|
+
if Util.file_containing?('Rakefile', /^task.+default.+(spec|test|feature)/)
|
|
4
4
|
invoke_cmd 'bundle_install'
|
|
5
5
|
|
|
6
6
|
announce 'Running tests with `rake`'
|
data/lib/geordi/util.rb
CHANGED
|
@@ -39,7 +39,7 @@ module Geordi
|
|
|
39
39
|
# @option fail_message: The text to print on command failure
|
|
40
40
|
def system!(*commands)
|
|
41
41
|
options = commands.last.is_a?(Hash) ? commands.pop : {}
|
|
42
|
-
note_cmd commands.
|
|
42
|
+
note_cmd commands.join(' ') if options[:show_cmd]
|
|
43
43
|
|
|
44
44
|
if options[:confirm]
|
|
45
45
|
prompt('Run this now?', 'n', /y|yes/) or fail('Cancelled.')
|
|
@@ -111,6 +111,15 @@ module Geordi
|
|
|
111
111
|
def stripped_lines(input_string)
|
|
112
112
|
input_string.lines.map(&:chomp).map(&:strip)
|
|
113
113
|
end
|
|
114
|
+
|
|
115
|
+
def capistrano3?
|
|
116
|
+
Util.file_containing? 'Capfile', 'capistrano/setup'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def file_containing?(file, regex)
|
|
120
|
+
File.exists?(file) and File.read(file).scan(regex).any?
|
|
121
|
+
end
|
|
122
|
+
|
|
114
123
|
end
|
|
115
124
|
end
|
|
116
125
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geordi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henning Koch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|