dual_burner 0.2.0 → 0.3.0

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: b1d8c2c25e1bcce734886cfcda729cafd83e81d0
4
- data.tar.gz: 6ec0cf8e2238eb616a706542cef5e7042246a77a
3
+ metadata.gz: b49df89d634d3ca0c8fe45b12f43309b757e1fdf
4
+ data.tar.gz: 0c552354fbfb4dda6474d75a0fd3f2361cb651b1
5
5
  SHA512:
6
- metadata.gz: bbe353d8e66511ae3e5556b2fa362f662f0bc4c7a7a6f96a6ea559048670fcfb03c2ebf41c82b78f2eb5a95c9711bef36d3486ac34da4b67b59194bb3c8993d0
7
- data.tar.gz: db3c3384cd97b8204674d0f3372962737237cb74ef19ab08c4187e550154dbd7b21d74783ad84bf1334d4197acc64f2547253304f65121d6729d9b791f2aed73
6
+ metadata.gz: e78945c728157e374466a0488c9e361c1e9cedfceab4674ccd3a63cf368521ce5aab6b9121bba739e46e2d5cd30e1e7a559fd06c5ac5753e8551c8af6eb07375
7
+ data.tar.gz: ff4b58dff18a06b39dac2096bc8f3d29cf97930beef3f9c75bcdcb36247d6f87f46409a664f5de1a8d23f7b6327f6cf4addae5d1c48602be3466cbeb144a3274
data/.rubocop.yml CHANGED
@@ -18,6 +18,9 @@ Metrics/MethodLength:
18
18
  Metrics/ParameterLists:
19
19
  Max: 6
20
20
 
21
+ Style/ClassLength:
22
+ Max: 110
23
+
21
24
  Style/Documentation:
22
25
  Enabled: false
23
26
 
data/README.md CHANGED
@@ -63,7 +63,9 @@ These are the possible configurations for your application.
63
63
  | color | no | The presentation color for display. |
64
64
  | heroku_app_name | no | The heroku app name. Needed only for Heroku related commands i.e. `dual_burner config_set`. |
65
65
 
66
- ## Deploying
66
+ ## Git Commands
67
+
68
+ ### Deploying
67
69
 
68
70
  Use the `dual_burner deploy` executable to deploy your projects.
69
71
 
@@ -85,19 +87,23 @@ You can pass in file locations of your deploy configuration if it is not under `
85
87
 
86
88
  `dual_burner deploy -c config/dual_burner.yml -e staging -g master`
87
89
 
88
- ## Latest Release
90
+ ### Latest Release
89
91
 
90
92
  You can verify that all versions are consistent with the following command.
91
93
 
92
94
  `dual_burner last_release -e wms_testing`
93
95
 
94
- ## Joining Heroku Apps
96
+ ## Heroku Commands
97
+
98
+ Please note, due to how the Heroku Toolbelt operations under a [locked version](https://github.com/heroku/toolbelt/issues/53#issuecomment-47022750) of ruby, do not use `bundle exec` or [install](https://github.com/heroku/toolbelt/issues/53#issuecomment-47022750) Heroku Toolbelt via `brew`.
99
+
100
+ ### Joining Heroku Apps
95
101
 
96
102
  You can join all Heroku apps in a cluster.
97
103
 
98
104
  `dual_burner join -e wms_testing`
99
105
 
100
- ## Heroku Config Management
106
+ ### Heroku Config Management
101
107
 
102
108
  You can set, unset, and verify consistency of Heroku configurations.
103
109
 
@@ -18,6 +18,25 @@ module DualBurner
18
18
  @apps ||= apps_for_environment
19
19
  end
20
20
 
21
+ def execute_command_with_threads(print_lines: true)
22
+ results = []
23
+ threads = []
24
+
25
+ apps.each do |app|
26
+ threads << Thread.new do
27
+ results << execute_command(
28
+ yield(app),
29
+ app: app,
30
+ print_lines: print_lines
31
+ )
32
+ end
33
+ end
34
+
35
+ threads.map(&:join)
36
+
37
+ results
38
+ end
39
+
21
40
  def apps_for_environment
22
41
  raise ArgumentError, 'ENV IS NOT PRESENT!' if env.nil?
23
42
  raise DualBurner::ConfigurationError, 'CONFIG IS NOT PRESENT!' unless File.exist?(configuration.deploy_file)
@@ -7,24 +7,21 @@ module DualBurner
7
7
  git_reference = 'master'
8
8
  end
9
9
 
10
- challenge_user!(git_reference: git_reference) if configuration.interactive?
11
-
12
- threads = []
13
- results = []
10
+ results = execute_command_with_threads do |app|
11
+ "git ls-remote #{app.remote_url}"
12
+ end
14
13
 
15
- apps.each do |app|
16
- # Execute each command in a separate thread.
17
- # Deploys can take a long time....
18
- threads << Thread.new do
19
- results << execute_command(
20
- build_deploy_command(app: app, git_reference: git_reference),
21
- app: app
22
- )
23
- end
14
+ # Ensure that the deployer has access to all git remotes.
15
+ unless verify_results_exit_0(results, context: 'deploy permissions')
16
+ return false
24
17
  end
25
18
 
26
- # Wait for all commands to complete.
27
- threads.map(&:join)
19
+ challenge_user!(git_reference: git_reference) if configuration.interactive?
20
+
21
+ # Deploys can take a long time....
22
+ results = execute_command_with_threads do |app|
23
+ build_deploy_command(app: app, git_reference: git_reference)
24
+ end
28
25
 
29
26
  verify_results_exit_0(results, context: 'deploys')
30
27
  end
@@ -21,10 +21,7 @@ module DualBurner
21
21
  method_option :env, aliases: '-e', type: :string, required: true, desc: ENV_DESC
22
22
  method_option :config, aliases: '-c', type: :string, optional: true, desc: CONFIG_DESC
23
23
  method_option :git_reference, aliases: '-g', default: 'master', type: :string, optional: true, desc: GIT_DESC
24
- method_option :join, aliases: '-j', default: true, optional: true, desc: 'Join all applications before deploy.'
25
24
  def deploy
26
- invoke(:join, [], env: options['env']) if options['join'] == true
27
-
28
25
  ::DualBurner::Commands::Deployer.new(
29
26
  env: options.fetch('env'),
30
27
  configuration: get_configuration_instance(deploy_file: options['config'])
@@ -1,3 +1,3 @@
1
1
  module DualBurner
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dual_burner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blue Apron Engineering