sunzi 1.5.2 → 2.0.0
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 +5 -5
- data/.travis.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/README.md +14 -37
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/{bin → exe}/sunzi +0 -0
- data/lib/sunzi.rb +18 -22
- data/lib/sunzi/actions.rb +35 -0
- data/lib/sunzi/cli.rb +6 -139
- data/lib/sunzi/command.rb +113 -0
- data/lib/sunzi/core_ext.rb +10 -0
- data/lib/sunzi/dependency.rb +26 -29
- data/lib/sunzi/endpoint.rb +17 -0
- data/lib/sunzi/plugin.rb +17 -0
- data/sunzi.gemspec +9 -9
- data/{lib/templates → templates}/create/.gitignore +0 -0
- data/{lib/templates → templates}/create/files/.gitkeep +0 -0
- data/{lib/templates → templates}/create/install.sh +13 -7
- data/{lib/templates → templates}/create/recipes/sunzi.sh +0 -0
- data/{lib/templates → templates}/create/roles/db.sh +0 -0
- data/{lib/templates → templates}/create/roles/web.sh +0 -0
- data/templates/create/sunzi.yml +27 -0
- data/templates/dependency/gemfile.erb +6 -0
- data/templates/dependency/install.erb +6 -0
- metadata +45 -36
- data/lib/sunzi/cloud.rb +0 -24
- data/lib/sunzi/cloud/base.rb +0 -98
- data/lib/sunzi/cloud/digital_ocean.rb +0 -78
- data/lib/sunzi/cloud/linode.rb +0 -154
- data/lib/sunzi/dns.rb +0 -25
- data/lib/sunzi/dns/base.rb +0 -7
- data/lib/sunzi/dns/linode.rb +0 -26
- data/lib/sunzi/dns/route53.rb +0 -25
- data/lib/sunzi/logger.rb +0 -17
- data/lib/sunzi/utility.rb +0 -17
- data/lib/templates/create/sunzi.yml +0 -30
- data/lib/templates/setup/digital_ocean/digital_ocean.yml +0 -28
- data/lib/templates/setup/linode/linode.yml +0 -42
- data/test/test_cli.rb +0 -40
data/test/test_cli.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'sunzi'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
|
4
|
-
class TestCli < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@cli = Sunzi::Cli.new
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_parse_target
|
10
|
-
assert_equal ['user', 'example.com', '2222'], @cli.parse_target('user@example.com:2222')
|
11
|
-
assert_equal ['root', 'example.com', '2222'], @cli.parse_target('example.com:2222')
|
12
|
-
assert_equal ['user', 'example.com', '22'], @cli.parse_target('user@example.com')
|
13
|
-
assert_equal ['root', 'example.com', '22'], @cli.parse_target('example.com')
|
14
|
-
assert_equal ['root', '192.168.0.1', '22'], @cli.parse_target('192.168.0.1')
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_parse_target_with_ssh_config
|
18
|
-
ssh_config = lambda do |host|
|
19
|
-
if host == 'example.com'
|
20
|
-
{ :host_name => "buzz.example.com", :user => "foobar", :port => 2222 }
|
21
|
-
else
|
22
|
-
{}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
Net::SSH::Config.stub(:for, ssh_config) do
|
27
|
-
assert_equal ['foobar', 'buzz.example.com', '2222'], @cli.parse_target('example.com')
|
28
|
-
assert_equal ['foobar', 'buzz.example.com', '8080'], @cli.parse_target('example.com:8080')
|
29
|
-
assert_equal ['piyo', 'buzz.example.com', '2222'], @cli.parse_target('piyo@example.com')
|
30
|
-
assert_equal ['piyo', 'buzz.example.com', '8080'], @cli.parse_target('piyo@example.com:8080')
|
31
|
-
assert_equal ['root', '192.168.0.1', '22'], @cli.parse_target('192.168.0.1')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_create
|
36
|
-
@cli.create 'sandbox'
|
37
|
-
assert File.exist?('sandbox/sunzi.yml')
|
38
|
-
FileUtils.rm_rf 'sandbox'
|
39
|
-
end
|
40
|
-
end
|