geordi 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6987f48d4bce3bf0e72d2395052b1147cd0b1f1dc4e3beea5d928e2a187a84e2
4
+ data.tar.gz: b72fa01a11225dc875a4c124f1d39d111a2bc5d4e4ef6f5a882adc34504335cf
5
+ SHA512:
6
+ metadata.gz: f04fd539fe8c3d286c28bfdfad3297cf9dcda5edf93eb4719a8bc25a383a04873c4fd2f3a716e65e806546685d8e6af3771d060926a2144fc60c1b68f912a34f
7
+ data.tar.gz: e3791d7d0d41c610a3b7a6c95a002e354235835948e3b55974dba99254594378f47114f9ffe8c4065ac575f91d6b0acc440c2579dcab0632efc3132037c4c585
@@ -1 +1 @@
1
- 2.6.3
1
+ 2.6.5
data/Gemfile CHANGED
@@ -8,3 +8,4 @@ gem 'rspec-mocks'
8
8
  gem 'highline'
9
9
  gem 'parallel_tests'
10
10
  gem 'launchy'
11
+ gem 'pry'
@@ -15,6 +15,7 @@ GEM
15
15
  builder (3.2.3)
16
16
  childprocess (1.0.1)
17
17
  rake (< 13.0)
18
+ coderay (1.1.2)
18
19
  cucumber (1.3.20)
19
20
  builder (>= 2.1.2)
20
21
  diff-lcs (>= 1.1.3)
@@ -27,11 +28,15 @@ GEM
27
28
  highline (1.6.21)
28
29
  launchy (2.4.3)
29
30
  addressable (~> 2.3)
31
+ method_source (0.9.2)
30
32
  multi_json (1.13.1)
31
33
  multi_test (0.1.2)
32
34
  parallel (0.5.16)
33
35
  parallel_tests (0.6.18)
34
36
  parallel
37
+ pry (0.12.2)
38
+ coderay (~> 1.1.0)
39
+ method_source (~> 0.9.0)
35
40
  rake (10.5.0)
36
41
  rspec-expectations (3.4.0)
37
42
  diff-lcs (>= 1.2.0, < 2.0)
@@ -51,6 +56,7 @@ DEPENDENCIES
51
56
  highline
52
57
  launchy
53
58
  parallel_tests
59
+ pry
54
60
  rspec-mocks
55
61
 
56
62
  BUNDLED WITH
@@ -0,0 +1,43 @@
1
+ Feature: The deploy command
2
+
3
+ Scenario: Deploying from master to staging
4
+
5
+ Unfortunately, Aruba cannot run commands truly interactively. We need to
6
+ answer prompts blindly, and check the output afterwards.
7
+
8
+ When I run `geordi deploy` interactively
9
+ # Answer three prompts
10
+ And I type "staging"
11
+ And I type "master"
12
+ And I type ""
13
+ # Confirm deployment
14
+ And I type "yes"
15
+ Then the output should contain:
16
+ """
17
+ # Checking whether your master branch is ready
18
+ > All good.
19
+
20
+ # You are about to:
21
+ > Deploy to staging
22
+ Go ahead with the deployment? [n]
23
+ """
24
+ And the output should contain:
25
+ """
26
+ > cap staging deploy:migrations
27
+ Util.system! cap staging deploy:migrations
28
+
29
+ > Deployment complete.
30
+ """
31
+
32
+
33
+ Scenario: Deploying the current branch
34
+
35
+ Deploying the current branch requires support by the deployed application:
36
+ its deploy config needs to pick up the DEPLOY_BRANCH environment variable.
37
+
38
+ When I run `geordi deploy --current-branch` interactively
39
+ # Answer deployment stage prompt
40
+ And I type "staging"
41
+ # Confirm deployment
42
+ And I type "yes"
43
+ Then the output should contain "DEPLOY_BRANCH=master cap staging deploy:migrations"
@@ -0,0 +1,3 @@
1
+ When /^I wait for (\d+) seconds?$/ do |seconds|
2
+ sleep seconds.to_i
3
+ end
@@ -28,6 +28,8 @@ LONGDESC
28
28
 
29
29
  option :no_migrations, :aliases => '-M', :type => :boolean,
30
30
  :desc => 'Run cap deploy instead of cap deploy:migrations'
31
+ option :current_branch, :aliases => '-b', :type => :boolean,
32
+ :desc => 'Set DEPLOY_BRANCH to the current branch during deploy'
31
33
 
32
34
  def deploy(target_stage = nil)
33
35
  # Set/Infer default values
@@ -40,14 +42,19 @@ def deploy(target_stage = nil)
40
42
 
41
43
  # Ask for required information
42
44
  target_stage = prompt 'Deployment stage:', proposed_stage
43
- source_branch = prompt 'Source branch:', Util.current_branch
44
- target_branch = prompt 'Deploy branch:', branch_stage_map.invert.fetch(target_stage, 'master')
45
+ if options.current_branch
46
+ source_branch = target_branch = Util.current_branch
47
+ else
48
+ source_branch = prompt 'Source branch:', Util.current_branch
49
+ target_branch = prompt 'Deploy branch:', branch_stage_map.invert.fetch(target_stage, 'master')
50
+ end
45
51
 
46
52
  merge_needed = (source_branch != target_branch)
47
53
  push_needed = merge_needed || `git cherry -v | wc -l`.strip.to_i > 0
54
+ push_needed = false if Util.testing? # Hard to test
48
55
 
49
56
  announce "Checking whether your #{source_branch} branch is ready"
50
- if `git status -s | wc -l`.strip != '0'
57
+ if `git status -s | wc -l`.strip != '0' and not Util.testing?
51
58
  warn "Your #{source_branch} branch holds uncommitted changes."
52
59
  prompt('Continue anyway?', 'n', /y|yes/) or fail 'Cancelled.'
53
60
  else
@@ -71,6 +78,7 @@ def deploy(target_stage = nil)
71
78
  capistrano_call = "cap #{target_stage} deploy"
72
79
  capistrano_call << ':migrations' unless Util.gem_major_version('capistrano') == 3 || options.no_migrations
73
80
  capistrano_call = "bundle exec #{capistrano_call}" if Util.file_containing?('Gemfile', /capistrano/)
81
+ capistrano_call = "DEPLOY_BRANCH=#{source_branch} #{capistrano_call}" if options.current_branch
74
82
 
75
83
  invoke_cmd 'bundle_install'
76
84
  invoke_cmd 'yarn_install'
@@ -45,7 +45,7 @@ module Geordi
45
45
  prompt('Run this now?', 'n', /y|yes/) or fail('Cancelled.')
46
46
  end
47
47
 
48
- if ENV['GEORDI_TESTING']
48
+ if testing?
49
49
  puts "Util.system! #{ commands.join ', ' }"
50
50
  else
51
51
  # Remove Geordi's Bundler environment when running commands.
@@ -73,7 +73,11 @@ module Geordi
73
73
  end
74
74
 
75
75
  def current_branch
76
- `git rev-parse --abbrev-ref HEAD`.strip
76
+ if testing?
77
+ 'master'
78
+ else
79
+ `git rev-parse --abbrev-ref HEAD`.strip
80
+ end
77
81
  end
78
82
 
79
83
  def deploy_targets
@@ -143,6 +147,10 @@ module Geordi
143
147
  File.exists?(file) and File.read(file).scan(regex).any?
144
148
  end
145
149
 
150
+ def testing?
151
+ !!ENV['GEORDI_TESTING']
152
+ end
153
+
146
154
  private
147
155
 
148
156
  def bundle_list
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.0'
3
3
  end
metadata CHANGED
@@ -1,43 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
- version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
6
- segments:
7
- - 2
8
- - 3
9
- - 0
10
- version: 2.3.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.4.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Henning Koch
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2019-08-27 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: thor
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
27
17
  - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 87
30
- segments:
31
- - 0
32
- - 18
33
- - 0
18
+ - !ruby/object:Gem::Version
34
19
  version: 0.18.0
35
20
  type: :runtime
36
- version_requirements: *id001
37
- description: Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.
38
- email:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.18.0
27
+ description: Collection of command line tools we use in our daily work with Ruby,
28
+ Rails and Linux at makandra.
29
+ email:
39
30
  - henning.koch@makandra.de
40
- executables:
31
+ executables:
41
32
  - b
42
33
  - cap-all
43
34
  - console-for
@@ -57,13 +48,11 @@ executables:
57
48
  - shell-for
58
49
  - tests
59
50
  extensions: []
60
-
61
51
  extra_rdoc_files: []
62
-
63
- files:
64
- - .gitignore
65
- - .ruby-version
66
- - .travis.yml
52
+ files:
53
+ - ".gitignore"
54
+ - ".ruby-version"
55
+ - ".travis.yml"
67
56
  - CHANGELOG.md
68
57
  - Gemfile
69
58
  - Gemfile.lock
@@ -90,12 +79,14 @@ files:
90
79
  - bin/tests
91
80
  - features/console.feature
92
81
  - features/cucumber.feature
82
+ - features/deploy.feature
93
83
  - features/dump.feature
94
84
  - features/firefox.feature
95
85
  - features/server.feature
96
86
  - features/shell.feature
97
87
  - features/support/env.rb
98
88
  - features/support/step_definitions/aruba_backport_steps.rb
89
+ - features/support/step_definitions/miscellaneous_steps.rb
99
90
  - geordi.gemspec
100
91
  - lib/geordi.rb
101
92
  - lib/geordi/COMMAND_TEMPLATE
@@ -142,41 +133,28 @@ files:
142
133
  - lib/geordi/remote.rb
143
134
  - lib/geordi/util.rb
144
135
  - lib/geordi/version.rb
145
- has_rdoc: true
146
136
  homepage: http://makandra.com
147
- licenses:
137
+ licenses:
148
138
  - MIT
149
- post_install_message: |
150
- * Binary `geordi` installed
151
-
139
+ metadata: {}
140
+ post_install_message: "* Binary `geordi` installed\n"
152
141
  rdoc_options: []
153
-
154
- require_paths:
142
+ require_paths:
155
143
  - lib
156
- required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
- requirements:
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ requirements:
159
146
  - - ">="
160
- - !ruby/object:Gem::Version
161
- hash: 3
162
- segments:
163
- - 0
164
- version: "0"
165
- required_rubygems_version: !ruby/object:Gem::Requirement
166
- none: false
167
- requirements:
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
150
+ requirements:
168
151
  - - ">="
169
- - !ruby/object:Gem::Version
170
- hash: 3
171
- segments:
172
- - 0
173
- version: "0"
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
174
154
  requirements: []
175
-
176
- rubyforge_project: geordi
177
- rubygems_version: 1.6.2
155
+ rubygems_version: 3.0.3
178
156
  signing_key:
179
- specification_version: 3
180
- summary: Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.
157
+ specification_version: 4
158
+ summary: Collection of command line tools we use in our daily work with Ruby, Rails
159
+ and Linux at makandra.
181
160
  test_files: []
182
-