capistrano_multiconfig_parallel 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.gitignore +21 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +68 -0
  6. data/.travis.yml +12 -0
  7. data/CONTRIBUTING.md +44 -0
  8. data/Gemfile +3 -0
  9. data/Guardfile +12 -0
  10. data/LICENSE +20 -0
  11. data/README.md +220 -0
  12. data/Rakefile +56 -0
  13. data/bin/multi_cap +7 -0
  14. data/capistrano_multiconfig_parallel.gemspec +51 -0
  15. data/img/parallel_demo.png +0 -0
  16. data/init.rb +1 -0
  17. data/lib/capistrano_multiconfig_parallel/application.rb +57 -0
  18. data/lib/capistrano_multiconfig_parallel/base.rb +92 -0
  19. data/lib/capistrano_multiconfig_parallel/celluloid/celluloid_manager.rb +178 -0
  20. data/lib/capistrano_multiconfig_parallel/celluloid/celluloid_worker.rb +238 -0
  21. data/lib/capistrano_multiconfig_parallel/celluloid/child_process.rb +104 -0
  22. data/lib/capistrano_multiconfig_parallel/celluloid/rake_worker.rb +83 -0
  23. data/lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb +49 -0
  24. data/lib/capistrano_multiconfig_parallel/celluloid/terminal_table.rb +122 -0
  25. data/lib/capistrano_multiconfig_parallel/cli.rb +55 -0
  26. data/lib/capistrano_multiconfig_parallel/configuration.rb +70 -0
  27. data/lib/capistrano_multiconfig_parallel/helpers/base_manager.rb +217 -0
  28. data/lib/capistrano_multiconfig_parallel/helpers/multi_app_manager.rb +84 -0
  29. data/lib/capistrano_multiconfig_parallel/helpers/single_app_manager.rb +48 -0
  30. data/lib/capistrano_multiconfig_parallel/helpers/standard_deploy.rb +40 -0
  31. data/lib/capistrano_multiconfig_parallel/initializers/conf.rb +6 -0
  32. data/lib/capistrano_multiconfig_parallel/initializers/confirm_question.rb +25 -0
  33. data/lib/capistrano_multiconfig_parallel/initializers/i18n.rb +10 -0
  34. data/lib/capistrano_multiconfig_parallel/initializers/rake.rb +28 -0
  35. data/lib/capistrano_multiconfig_parallel/multi_app_helpers/dependency_tracker.rb +111 -0
  36. data/lib/capistrano_multiconfig_parallel/multi_app_helpers/interactive_menu.rb +61 -0
  37. data/lib/capistrano_multiconfig_parallel/version.rb +16 -0
  38. data/lib/capistrano_multiconfig_parallel.rb +2 -0
  39. data/spec/spec_helper.rb +48 -0
  40. metadata +648 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 96a47c7dcecfeada5fe7fb23dd257df92fd521f9
4
+ data.tar.gz: 20512948d23bc465d2bb4146ed7f41ffe887f991
5
+ SHA512:
6
+ metadata.gz: 724ae116cd13d103f79ed45225d74a68cce7087e5e068d1d5a440597a228a85375523a9ab7c29a5940a5f3d3f9708fa430ae88f1449396456108f63d776631e6
7
+ data.tar.gz: 0054782386ac8e6eacae69d3fb3e166e49170bf31d9893417f7d9d4fa7bd810a0cdeb6c1ed4cb534110c19e1cd4b73f7953980bea50ba09a6152e5a4a6053faa
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-ci
2
+ repo_token: 8c9edNJkEV8BFTLrfU11md2H4FsSEPT9b
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ s.rbx/
2
+ .bundle/
3
+ *.gem
4
+ .idea/
5
+ .rvmrc
6
+ *.swp
7
+ log/*.log
8
+ pkg/
9
+ spec/dummy/db/*.sqlite3
10
+ spec/dummy/log/*.log
11
+ spec/dummy/tmp/
12
+ coverage
13
+ tags
14
+ Gemfile.lock
15
+ /nbproject/
16
+ /.git-rewrite/
17
+ /bin/**/*
18
+
19
+ # But not these files...
20
+ !.gitignore
21
+ !/bin/multi_cap
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/.rubocop.yml ADDED
@@ -0,0 +1,68 @@
1
+ AllCops:
2
+ Exclude:
3
+ - capistrano_multiconfig_parallel.gemspec
4
+ - bin/**/*
5
+ - Guardfile
6
+
7
+ Documentation:
8
+ Enabled: true
9
+
10
+ Encoding:
11
+ Enabled: false
12
+
13
+ LineLength:
14
+ Max: 200
15
+
16
+ AccessModifierIndentation:
17
+ EnforcedStyle: outdent
18
+
19
+ IfUnlessModifier:
20
+ Enabled: false
21
+
22
+ CaseIndentation:
23
+ IndentWhenRelativeTo: case
24
+ IndentOneStep: true
25
+
26
+ MethodLength:
27
+ CountComments: false
28
+ Max: 20
29
+
30
+ SignalException:
31
+ Enabled: false
32
+
33
+ ColonMethodCall:
34
+ Enabled: false
35
+
36
+ AsciiComments:
37
+ Enabled: false
38
+
39
+ RegexpLiteral:
40
+ Enabled: false
41
+
42
+ AssignmentInCondition:
43
+ Enabled: false
44
+
45
+ ParameterLists:
46
+ CountKeywordArgs: false
47
+
48
+ SingleLineBlockParams:
49
+ Methods:
50
+ - reduce:
51
+ - memo
52
+ - item
53
+
54
+ Metrics/AbcSize:
55
+ Enabled: false
56
+
57
+ Style/CollectionMethods:
58
+ Enabled: true
59
+
60
+ Style/SymbolArray:
61
+ Enabled: true
62
+
63
+ Style/ExtraSpacing:
64
+ Enabled: true
65
+
66
+ Style/FileName:
67
+ Enabled: false
68
+
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ before_install:
3
+ - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
4
+ - gem install bundler
5
+ rvm:
6
+ - 1.9.3
7
+ - jruby-19mode
8
+ - 2.0.0
9
+ env:
10
+ - RAILS_ENV=test RACK_ENV=test
11
+ notifications:
12
+ email: false
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,44 @@
1
+ # Contributing
2
+
3
+ We love pull requests. Here's a quick guide.
4
+
5
+ Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
6
+
7
+ Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
8
+
9
+ Fork, then clone the repo:
10
+
11
+ git clone git@github.com:your-username/capistrano_multiconfig_parallel.git
12
+
13
+ Start a feature/bugfix branch.
14
+
15
+ Set up your machine:
16
+
17
+ bundle install
18
+
19
+ Make sure the tests pass:
20
+
21
+ bundle exec rake
22
+
23
+ Make your change. Add tests for your change. Make the tests pass:
24
+
25
+ bundle exec rake
26
+
27
+ Push to your fork and [submit a pull request][pr].
28
+
29
+ [pr]: https://github.com/bogdanRada/capistrano_multiconfig_parallel/compare
30
+
31
+ At this point you're waiting on us. We like to at least comment on pull requests
32
+ within three business days (and, typically, one business day). We may suggest
33
+ some changes or improvements or alternatives.
34
+
35
+ Some things that will increase the chance that your pull request is accepted:
36
+
37
+ * Write tests.
38
+ * Try to follow this [style guide][style].
39
+ * Write a [good commit message][commit].
40
+
41
+ [style]: https://github.com/thoughtbot/guides/tree/master/style
42
+ [commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
43
+
44
+ Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,12 @@
1
+ # More info at https://github.com/guard/guard#readme
2
+
3
+ # Could be changed to whatever you want.
4
+ # See: https://github.com/guard/guard#notification
5
+ notification :off
6
+
7
+ guard 'rspec' do
8
+ watch %r{^spec/.+_spec\.rb$}
9
+ watch %r{lib/} do 'spec' end
10
+ end
11
+
12
+ # vim:ft=ruby
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 bogdanRada
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,220 @@
1
+ capistrano_multiconfig_parallel
2
+ ==================
3
+
4
+
5
+ Description
6
+ --------
7
+ CapistranoMulticonfigParallel is a simple ruby implementation that allows you to run multiple tasks in parallel for multiple applications and uses websockets for inter-process communication and has a interactive menu
8
+
9
+ IMPORTANT! The whole reason for this gem was for using [Caphub][caphub] in a more easy way and allowing you to run tasks in parallel for multiple aplications .
10
+ However this can be used for normal applications also, if you want for example to deploy your app to multiple sandboxes on development environment
11
+ or even deploy in parallel to multiple stages.
12
+
13
+ CAUTION!! PLEASE READ CAREFULLY!! Capistrano is not thread-safe. However in order to work around this problem, each of the task is executing inside a thread that spawns a new process in order to run capistrano tasks
14
+ The thread monitors the process. This works well, however if the tasks you are executing is working with files, you might get into deadlocks because multiple proceses try to access same resource.
15
+ Instead of using files , please consider using StringIO instead.
16
+
17
+ [caphub]: https://github.com/railsware/caphub
18
+
19
+ Requirements
20
+ --------
21
+ 1. [Ruby 1.9.x or Ruby 2.x.x][ruby]
22
+ 2. [ActiveSuport >= 4.2.0][activesupport]
23
+ 3. [celluloid-pmap >= 0.2.0][celluloid_pmap]
24
+ 4. [celluloid_pubsub >= 0.0.11][celluloid_pubsub]
25
+ 5. [composable_state_machine >= 1.0.2][composable_state_machine]
26
+ 6. [terminal-table >= 1.4.5][terminal_table]
27
+ 7. [formatador >= 0.2.5] [formatador]
28
+ 8. [colorize] [colorize]
29
+ 9. [eventmachine >= 1.0.7] [eventmachine]
30
+ 10. [right_popen >= 1.1.3] [right_popen]
31
+ 11. [capistrano-multiconfig >= 3.0.8] [capistrano-multiconfig]
32
+ 12. [capistrano >= 3.0] [capistrano]
33
+ 13. [configurations >= 2.0.0] [configurations]
34
+
35
+ [ruby]: http://www.ruby-lang.org
36
+ [activesupport]:https://rubygems.org/gems/activesupport
37
+ [celluloid_pubsub]:https://github.com/bogdanRada/celluloid_pubsub
38
+ [celluloid_pmap]:https://github.com/jwo/celluloid-pmap
39
+ [composable_state_machine]: https://github.com/swoop-inc/composable_state_machine
40
+ [terminal_table]: https://github.com/tj/terminal-table
41
+ [formatador]: https://github.com/geemus/formatador
42
+ [colorize]: https://github.com/fazibear/colorize
43
+ [eventmachine]: https://github.com/eventmachine/eventmachine
44
+ [right_popen]: https://github.com/rightscale/right_popen
45
+ [capistrano-multiconfig]: https://github.com/railsware/capistrano-multiconfig
46
+ [capistrano]: https://github.com/capistrano/capistrano/
47
+ [configurations]: https://github.com/beatrichartz/configurations
48
+
49
+ Compatibility
50
+ --------
51
+
52
+ Rails >3.0 only. MRI 1.9.x, 2.x
53
+
54
+ Ruby 1.8 is not officially supported. We will accept further compatibilty pull-requests but no upcoming versions will be tested against it.
55
+
56
+ Rubinius and Jruby support temporarily dropped due to Rails 4 incompatibility.
57
+
58
+ Installation Instructions
59
+ --------
60
+
61
+ Add the following to your Gemfile:
62
+
63
+ ```ruby
64
+ gem "capistrano_multiconfig_parallel"
65
+ ```
66
+
67
+
68
+ Add the following to your Capfile:
69
+
70
+ ```ruby
71
+ require 'capistrano_multiconfig_parallel'
72
+ ```
73
+
74
+ Please read [Release Details][release-details] if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.
75
+ [release-details]: https://github.com/bogdanRada/capistrano_multiconfig_parallel/releases
76
+
77
+ Usage Instructions
78
+ --------
79
+
80
+ [![capistrano multiconfig parallel ](img/parallel_demo.png)](#features)
81
+
82
+ 1. Single Apps ( normal Rails or rack applications)
83
+
84
+ CapistranoMulticonfigParallel recognizes only "development" and "webdev" as stages for development
85
+ if you use other stages for development, you need to configure it like this. This will override the default configuration.
86
+ You will need to require this file in your Capfile also.
87
+
88
+ ```ruby
89
+ CapistranoMulticonfigParallel.configure do |c|
90
+ c.development_stages = ["development", "some_other_stage"]
91
+ end
92
+ ```
93
+ ### Deploying the application to multiple sandboxes ( works only with development environments)
94
+
95
+ ```shell
96
+ # <box_name> - the name of a sandbox
97
+ #<development_stage> - the name of one of the stages you previously configured
98
+ #<task_name> - the capistrano task that you want to execute ( example: 'deploy' )
99
+
100
+ bundle exec multi_cap <development_stage> <task_name> BOX=<box_name>,<box_name>
101
+
102
+ ```
103
+
104
+ If a branch is specified using "BRANCH=name" it will deploy same branch to all sandboxes
105
+ If a branch is not specified, will ask for each of the sandboxes the name of the branch to deploy
106
+ The branch environment variable is then passed to the capistrano task
107
+
108
+ Also the script will ask if there are any other environment variables that user might want to pass to each of the sandboxes separately.
109
+
110
+ ### Deploying the application to multiple stages ( Using the customized command "deploy_stages")
111
+
112
+
113
+ ```shell
114
+
115
+ bundle exec multi_cap deploy_stages STAGES=development, staging, production
116
+ ```
117
+
118
+ If a branch is specified using "BRANCH=name" it will deploy same branch to all stages
119
+ If a branch is not specified, will ask for each of the stage the name of the branch to deploy
120
+ The branch environment variable is then passed to the capistrano process
121
+
122
+ Also the script will ask if there are any other environment variables that user might want to pass to each of the stages separately.
123
+
124
+
125
+
126
+ 2. Multiple Apps ( like [Caphub][caphub] )
127
+
128
+
129
+ Configuration for this types of application is more complicated
130
+
131
+ ```ruby
132
+ CapistranoMulticonfigParallel.configure do |c|
133
+ c.development_stages = ['development', 'webdev']
134
+ c.task_confirmation_active = true
135
+ c.task_confirmations = ['deploy:symlink:release']
136
+ c.track_dependencies = true
137
+ c.application_dependencies = [
138
+ { app: 'blog', priority: 1, dependencies: [] },
139
+ { app: 'blog2', priority: 2, dependencies: ['blog'] },
140
+ { app: 'blog3', priority: 3, dependencies: ['blog', 'blog2'] },
141
+ ]
142
+ end
143
+ ```
144
+
145
+ The "development_stages" options is used so that the gem can know if sandboxes are allowed for those environments.
146
+
147
+ The "task_confirmation_active" option can have only two values:
148
+ - false - all threads are executing normally without needing confirmation from user
149
+ - true - means threads need confirmation from user ( Can we used to synchronize all processes to wait before executing a task)
150
+ For this we use the option "task_confirmations" which is a array with string.
151
+ Each string is the name of the task that needs confirmation.
152
+
153
+
154
+ If you want to deploy an application with dependencies you can use the option "track_dependencies".
155
+ If that options has value "true" , it will ask the user before deploying a application if he needs the dependencies deployed too
156
+
157
+ The dependencies are being kept in the option "application_dependencies"
158
+ This is an array of hashes. Each hash has only the keys "app" ( app name), "priority" and "dependencies" ( an array of app names that this app is dependent to)
159
+
160
+ Default Configuration:
161
+ --------
162
+
163
+ ```ruby
164
+ CapistranoMulticonfigParallel.configure do |c|
165
+ c.task_confirmations = ['deploy:symlink:release']
166
+ c.task_confirmation_active = false
167
+ c.track_dependencies = false
168
+ c.websocket_server = { enable_debug: false }
169
+ c.development_stages = ['development', 'webdev']
170
+ end
171
+ ```
172
+
173
+ Available command line options when executing a command
174
+ --------
175
+
176
+ --multi-debug
177
+ If option is present , will enable debugging of workers
178
+
179
+ --multi-progress
180
+ If option is present will first execute before any process , same task but with option "--dry-run" in order to show progress of how many tasks are in total for that task and what is the progress of executing
181
+ This will slow down the workers , because they will execute twice the same task.
182
+
183
+ --multi-secvential
184
+ If parallel executing does not work for you, you can use this option so that each process is executed normally and ouputted to the screen.
185
+ However this means that all other tasks will have to wait for each other to finish before starting
186
+
187
+ Testing
188
+ --------
189
+
190
+ To test, do the following:
191
+
192
+ 1. cd to the gem root.
193
+ 2. bundle install
194
+ 3. bundle exec rake
195
+
196
+ Contributions
197
+ --------
198
+
199
+ Please log all feedback/issues via [Github Issues][issues]. Thanks.
200
+
201
+ [issues]: http://github.com/bogdanRada/capistrano_multiconfig_parallel/issues
202
+
203
+ Contributing to capistrano_multiconfig_parallel
204
+ --------
205
+
206
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
207
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
208
+ * Fork the project.
209
+ * Start a feature/bugfix branch.
210
+ * Commit and push until you are happy with your contribution.
211
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
212
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
213
+ * You can read more details about contributing in the [Contributing][contributing] document
214
+
215
+ [contributing]: https://github.com/bogdanRada/capistrano_multiconfig_parallel/blob/master/CONTRIBUTING.md
216
+
217
+ == Copyright
218
+
219
+ Copyright (c) 2015 bogdanRada. See LICENSE.txt for
220
+ further details.
data/Rakefile ADDED
@@ -0,0 +1,56 @@
1
+ require 'bundler/setup'
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+ require 'coveralls/rake/task'
5
+ require 'yard'
6
+ require 'yard-rspec'
7
+ Coveralls::RakeTask.new
8
+
9
+ RSpec::Core::RakeTask.new(:spec) do |spec|
10
+ spec.rspec_opts = ['--backtrace '] if ENV['DEBUG']
11
+ end
12
+
13
+ # desc "Prepare dummy application"
14
+ # task :prepare do
15
+ # ENV["RAILS_ENV"] ||= 'test'
16
+ # require File.expand_path("./spec/dummy/config/environment", File.dirname(__FILE__))
17
+ # Dummy::Application.load_tasks
18
+ # Rake::Task["db:test:prepare"].invoke
19
+ # end
20
+ YARD::Config.options[:load_plugins] = true
21
+ YARD::Config.load_plugins
22
+
23
+ YARD::Rake::YardocTask.new do |t|
24
+ t.files = ['lib/**/*.rb', 'spec/**/*_spec.rb'] # optional
25
+ t.options = ['--any', '--extra', '--opts', '--markup-provider=redcarpet', '--markup=markdown', '--debug'] # optional
26
+ t.stats_options = ['--list-undoc'] # optional
27
+ end
28
+
29
+ unless ENV['TRAVIS']
30
+ require 'rvm-tester'
31
+ RVM::Tester::TesterTask.new(:suite) do |t|
32
+ t.rubies = %w(1.9.3 2.0.0 2.1.0) # which versions to test (required!)
33
+ t.bundle_install = true # updates Gemfile.lock, default is true
34
+ t.use_travis = true # looks for Rubies in .travis.yml (on by default)
35
+ t.command = 'bundle exec rake' # runs plain "rake" by default
36
+ t.env = { 'VERBOSE' => '1', 'RAILS_ENV' => 'test', 'RACK_ENV' => 'test' } # set any ENV vars
37
+ t.num_workers = 5 # defaults to 3
38
+ t.verbose = true # shows more output, off by default
39
+ end
40
+ end
41
+
42
+ desc 'Default: run the unit tests.'
43
+ task default: [:all]
44
+
45
+ desc 'Test the plugin under all supported Rails versions.'
46
+ task :all do |_t|
47
+ if ENV['TRAVIS']
48
+ exec(' bundle exec phare && bundle exec rake spec && bundle exec rake coveralls:push')
49
+ else
50
+ exec('bundle exec rubocop -a . && bundle exec phare && bundle exec rake spec')
51
+ end
52
+ end
53
+
54
+ task :docs do
55
+ exec(' bundle exec rubocop -a . && bundle exec phare && bundle exec inch --pedantic && bundle exec yard')
56
+ end
data/bin/multi_cap ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require "pathname"
3
+ bin_file = Pathname.new(__FILE__).realpath
4
+ # add self to libpath
5
+ $:.unshift File.expand_path("../../lib", bin_file)
6
+ require "capistrano_multiconfig_parallel/cli"
7
+ CapistranoMulticonfigParallel::CLI.start
@@ -0,0 +1,51 @@
1
+ require File.expand_path('../lib/capistrano_multiconfig_parallel/version', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'capistrano_multiconfig_parallel'
5
+ s.version = CapistranoMulticonfigParallel.gem_version
6
+ s.platform = Gem::Platform::RUBY
7
+ s.description = 'CapistranoMulticonfigParallel is a simple ruby implementation that allows you to run multiple tasks in parallel for single or multiple applications and uses websockets for inter-process communication and has a interactive menu'
8
+ s.email = 'raoul_ice@yahoo.com'
9
+ s.homepage = 'http://github.com/bogdanRada/capistrano_multiconfig_parallel/'
10
+ s.summary = 'CapistranoMulticonfigParallel is a simple ruby implementation that allows you to run multiple tasks in parallel and uses websockets for inter-process communication and has a interactive menu'
11
+ s.authors = ['bogdanRada']
12
+ s.date = Date.today
13
+
14
+ s.licenses = ['MIT']
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = s.files.grep(/^(spec)/)
17
+ s.require_paths = ['lib']
18
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+
20
+ s.add_runtime_dependency 'celluloid-pmap', '~> 0.2', '>= 0.2.0'
21
+ s.add_runtime_dependency 'celluloid_pubsub', '~> 0.0', '>= 0.0.15'
22
+ s.add_runtime_dependency 'composable_state_machine', '~> 1.0', '>= 1.0.2'
23
+ s.add_runtime_dependency 'terminal-table', '~> 1.4', '>= 1.4.5'
24
+ s.add_runtime_dependency 'formatador', '~> 0.2', '>= 0.2.5'
25
+ s.add_runtime_dependency 'colorize', '~> 0.7', '>= 0.7'
26
+ s.add_runtime_dependency 'eventmachine', '~> 1.0', '>= 1.0.3'
27
+ s.add_runtime_dependency 'right_popen', '~> 1.1', '>= 1.1.3'
28
+ s.add_runtime_dependency 'capistrano-multiconfig','~> 3.0', '>= 3.0.8'
29
+ s.add_runtime_dependency 'capistrano','~> 3.0','>= 3.0'
30
+ s.add_runtime_dependency 'activesupport', '~> 4.0','>= 4.0'
31
+ s.add_runtime_dependency 'configurations', '~> 2.0', '>= 2.0.0'
32
+
33
+
34
+ s.add_development_dependency 'rspec-rails', '~> 2.0', '>= 2.0'
35
+ s.add_development_dependency 'guard', '~> 2.6', '>= 2.6.1'
36
+ s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.9'
37
+ s.add_development_dependency 'simplecov', '~> 0.9', '>= 0.9'
38
+ s.add_development_dependency 'simplecov-summary', '~> 0.0.4', '>= 0.0.4'
39
+ s.add_development_dependency 'mocha', '~> 1.1', '>= 1.1'
40
+ s.add_development_dependency 'coveralls', '~> 0.7', '>= 0.7'
41
+ s.add_development_dependency 'rvm-tester', '~> 1.1', '>= 1.1'
42
+
43
+ s.add_development_dependency 'rubocop', '0.29', '>= 0.29'
44
+ s.add_development_dependency 'phare', '~> 0.6', '>= 0.6'
45
+ s.add_development_dependency 'yard', '~> 0.8', '>= 0.8.7'
46
+ s.add_development_dependency 'yard-rspec', '~> 0.1', '>= 0.1'
47
+ s.add_development_dependency 'redcarpet', '~> 3.2', '>= 3.2.2'
48
+ s.add_development_dependency 'github-markup', '~> 1.3', '>= 1.3.3'
49
+ s.add_development_dependency 'inch', '~> 0.5', '>= 0.5.10'
50
+ s.add_development_dependency 'guard-inch', '~> 0.1', '>= 0.1.0'
51
+ end
Binary file
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'capistrano_multiconfig_parallel'
@@ -0,0 +1,57 @@
1
+ module CapistranoMulticonfigParallel
2
+ # class used as a wrapper around capistrano
3
+ class Application < Capistrano::Application
4
+ def name
5
+ 'multi_cap'
6
+ end
7
+
8
+ def sort_options(options)
9
+ super.push(multi_debug, multi_progress, multi_secvential)
10
+ end
11
+
12
+ def multi_debug
13
+ ['--multi-debug', '-D',
14
+ 'Sets the debug enabled for celluloid actors',
15
+ lambda do |_value|
16
+ CapistranoMulticonfigParallel::CelluloidManager.debug_enabled = true
17
+ Celluloid.task_class = Celluloid::TaskThread
18
+ end
19
+ ]
20
+ end
21
+
22
+ def multi_progress
23
+ ['--multi-progress', '--multi-progress',
24
+ 'Sets the debug enabled for celluloid actors',
25
+ lambda do |_value|
26
+ CapistranoMulticonfigParallel.show_task_progress = true
27
+ end
28
+ ]
29
+ end
30
+
31
+ def multi_secvential
32
+ ['--multi-secvential', '--multi-secvential',
33
+ 'Sets the debug enabled for celluloid actors',
34
+ lambda do |_value|
35
+ CapistranoMulticonfigParallel.execute_in_sequence = true
36
+ end
37
+ ]
38
+ end
39
+
40
+ def top_level
41
+ job_manager = multi_manager_class.new(self, top_level_tasks, stages)
42
+ if job_manager.can_start? && !options.show_prereqs && !options.show_tasks
43
+ job_manager.start
44
+ else
45
+ super
46
+ end
47
+ end
48
+
49
+ def multi_apps?
50
+ stages.find { |stage| stage.include?(':') }.present?
51
+ end
52
+
53
+ def multi_manager_class
54
+ multi_apps? ? CapistranoMulticonfigParallel::MultiAppManager : CapistranoMulticonfigParallel::SingleAppManager
55
+ end
56
+ end
57
+ end