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 +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +10 -4
- data/lib/dual_burner/base_command.rb +19 -0
- data/lib/dual_burner/commands/deployer.rb +12 -15
- data/lib/dual_burner/runner.rb +0 -3
- data/lib/dual_burner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b49df89d634d3ca0c8fe45b12f43309b757e1fdf
|
4
|
+
data.tar.gz: 0c552354fbfb4dda6474d75a0fd3f2361cb651b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78945c728157e374466a0488c9e361c1e9cedfceab4674ccd3a63cf368521ce5aab6b9121bba739e46e2d5cd30e1e7a559fd06c5ac5753e8551c8af6eb07375
|
7
|
+
data.tar.gz: ff4b58dff18a06b39dac2096bc8f3d29cf97930beef3f9c75bcdcb36247d6f87f46409a664f5de1a8d23f7b6327f6cf4addae5d1c48602be3466cbeb144a3274
|
data/.rubocop.yml
CHANGED
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
|
-
##
|
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
|
-
|
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
|
-
##
|
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
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
results = []
|
10
|
+
results = execute_command_with_threads do |app|
|
11
|
+
"git ls-remote #{app.remote_url}"
|
12
|
+
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
27
|
-
|
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
|
data/lib/dual_burner/runner.rb
CHANGED
@@ -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'])
|
data/lib/dual_burner/version.rb
CHANGED