mina-multi_server 0.0.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 +7 -0
- data/LICENSE +19 -0
- data/README.md +46 -0
- data/lib/mina/multi_server.rb +20 -0
- data/mina-multi_server.gemspec +12 -0
- metadata +61 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fee909d15439bd98a7e8b4c50d325558ae4b6d77
|
4
|
+
data.tar.gz: 8cc1e0ff59074c09a9f7c3c8d63787b41153f85b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b68a79454b2e86451699e927759c1748cea5e8bca2419db82c0a526d19519bc972af6f1539118d6c9ac8e467abf298f5bb8e427c4aae8d120db4554e22755e8
|
7
|
+
data.tar.gz: e21983ceb8f7e906eb30489f1c8cb027fae97fd812dab84dd009e3ac4fd763f2635d26bc74e53289b7cb63f1c1c70a0968861faa75147b478ae097c0c4dbf99d
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2017 Juan Manuel Cuello
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
8
|
+
so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Mina Multi Server
|
2
|
+
====
|
3
|
+
|
4
|
+
This is an extremely simple gem that adds multi-server support to Mina tasks. In
|
5
|
+
order to avoid complexity, each task is executed **sequentially**. You should
|
6
|
+
look to other solutions if you need parallel execution.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
gem install mina-multi_server
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
Set a `server` array in your deploy.rb with the hostnames of the servers where
|
15
|
+
you want the tasks to be executed.
|
16
|
+
|
17
|
+
When using `mina-multi_server`, there is no need to set a `domain` var as Mina
|
18
|
+
requires.
|
19
|
+
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
# deploy.rb
|
23
|
+
|
24
|
+
require 'mina/multi_server'
|
25
|
+
|
26
|
+
task :production do
|
27
|
+
set :servers, ['server-1.example.com', 'server-2.example.com']
|
28
|
+
end
|
29
|
+
|
30
|
+
# ...
|
31
|
+
|
32
|
+
```
|
33
|
+
|
34
|
+
```console
|
35
|
+
$ mina production deploy
|
36
|
+
```
|
37
|
+
|
38
|
+
## How it works
|
39
|
+
|
40
|
+
Each remote task will be executed for each server, setting Mina's `domain` var
|
41
|
+
to each value of the `servers` array.
|
42
|
+
|
43
|
+
For non-remote tasks, each task will be executed only once, `servers` var will
|
44
|
+
not be used and no `domain` var will be set.
|
45
|
+
|
46
|
+
Tasks will be executed one after the other, sequentially.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Mina
|
2
|
+
class Commands
|
3
|
+
alias :mina_run :run
|
4
|
+
|
5
|
+
def run(backend)
|
6
|
+
backend == :remote ? on_each_server { mina_run(backend) } : mina_run(backend)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Helpers::Internal
|
11
|
+
def on_each_server
|
12
|
+
ensure!(:servers)
|
13
|
+
fetch(:servers).each do |server|
|
14
|
+
print_stdout "Server: #{server}"
|
15
|
+
set(:domain, server)
|
16
|
+
yield
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.author = ['Juan Manuel Cuello']
|
3
|
+
s.files = `git ls-files`.split("\n")
|
4
|
+
s.email = 'juanmacuello@gmail.com'
|
5
|
+
s.homepage = 'https://github.com/Juanmcuello/mina-multi_server'
|
6
|
+
s.license = 'MIT'
|
7
|
+
s.name = 'mina-multi_server'
|
8
|
+
s.summary = 'Mina multi-server support'
|
9
|
+
s.version = '0.0.1'
|
10
|
+
|
11
|
+
s.add_dependency 'mina', '~> 1.0'
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-multi_server
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Juan Manuel Cuello
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
description:
|
28
|
+
email: juanmacuello@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- LICENSE
|
34
|
+
- README.md
|
35
|
+
- lib/mina/multi_server.rb
|
36
|
+
- mina-multi_server.gemspec
|
37
|
+
homepage: https://github.com/Juanmcuello/mina-multi_server
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.5.1
|
58
|
+
signing_key:
|
59
|
+
specification_version: 4
|
60
|
+
summary: Mina multi-server support
|
61
|
+
test_files: []
|