niso 2.0.3 → 2.0.4
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 +4 -4
- data/.travis.yml +4 -0
- data/CHANGELOG.md +4 -17
- data/README.md +12 -3
- data/lib/niso/cli.rb +6 -6
- data/lib/niso/cloud/droplet_kit.rb +43 -21
- data/lib/niso/cloud.rb +1 -1
- data/lib/templates/setup/{droplet_kit.yml → do.yml} +2 -1
- data/niso.gemspec +9 -7
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0074b90f949a83689f8db0031d321a8db28d939c
|
4
|
+
data.tar.gz: 31135e9d544df3c9accd52c3b76d9170bd522cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89a037a690ad3174fcf675b5692671ea1e907f9b06805451279cd168a25b3379d85236f1c5dfc716b3ab91f9c14d9690ed2976f2118e5a8f232044d9846a5f70
|
7
|
+
data.tar.gz: 2a4303b6f1b3e0cba82ce9b834eeb71aa6523615d6aae3b4ba5d8805e178b519cc717849799391100e71b1f680d291800bbe2b20d1269305699422b0bdd54db0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,8 @@
|
|
1
|
+
## 2.0.4, release 2017-03-30
|
2
|
+
* bug fixes
|
3
|
+
* updated to set dependencies
|
4
|
+
|
1
5
|
## 2.0, release 2017-03-28
|
2
6
|
* updated to explicitly use digital ocean for `niso setup` and `niso teardown`
|
3
7
|
* added `droplet_kit`
|
4
8
|
* removed `digital_ocean`
|
5
|
-
|
6
|
-
## 1.5, release 2013-09-27
|
7
|
-
* `niso deploy [linode|digital_ocean] [name]` will deploy to the instance with additional attributes.
|
8
|
-
|
9
|
-
## 1.4, release 2013-09-27
|
10
|
-
* `niso teardown` no longer requires instance names as an argument, it lets you choose from a list instead.
|
11
|
-
|
12
|
-
## Past Releases
|
13
|
-
* v1.3: SSH config support. Thanks to @toooooooby
|
14
|
-
* v1.2: Evaluate everything as ERB templates by default. Added "files" folder.
|
15
|
-
* v1.1: "set -e" by default. apt-get everywhere in place of aptitude. Linode DNS support for DigitalOcean instances.
|
16
|
-
* v1.0: System functions are refactored into niso.mute() and niso.install().
|
17
|
-
* v0.9: Support for [DigitalOcean](https://www.digitalocean.com) setup / teardown.
|
18
|
-
* v0.8: Added `--sudo` option to `niso deploy`.
|
19
|
-
* v0.7: Added `erase_remote_folder` and `cache_remote_recipes` preferences for customized behavior.
|
20
|
-
* v0.6: System function niso::silencer() added for succinct log messages.
|
21
|
-
* v0.5: Role-based configuration supported. Reworked directory structure. **Incompatible with previous versions**.
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# nîso ᓃᓱ
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/niso) [](https://travis-ci.org/dakotalightning/niso)
|
4
|
+
|
3
5
|
niso is the number 2 (two) in Cree
|
4
6
|
|
5
7
|
## Quickstart
|
@@ -66,24 +68,31 @@ For instance, when you set up a new web server, deploy with a role name:
|
|
66
68
|
|
67
69
|
It is equivalent to running `install.sh`, followed by `web.sh`.
|
68
70
|
|
69
|
-
|
71
|
+
## Requirements
|
70
72
|
|
71
73
|
For `niso deploy`
|
72
74
|
|
73
75
|
$ [sudo] gem install droplet_kit
|
74
76
|
$ [sudo] gem install highline
|
75
77
|
|
76
|
-
|
78
|
+
## DigitalOcean
|
77
79
|
You can setup a new VM, or teardown an existing VM interactively. Use `niso setup` and `niso teardown` for that.
|
78
80
|
|
79
81
|
[DigitalOcean](https://www.digitalocean.com) only.
|
80
82
|
|
81
83
|
v2.0 of the DigitalOcean API is supported — get your [access token](https://cloud.digitalocean.com/api_access).
|
82
84
|
|
83
|
-
|
85
|
+
## Changelong:
|
84
86
|
|
85
87
|
Please see the [CHANGELOG](https://github.com/dakotalightning/niso/blob/master/CHANGELOG.md).
|
86
88
|
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
1. Fork the project
|
92
|
+
2. Make your changes, including tests that exercise the code
|
93
|
+
3. Summarize your changes in [CHANGELOG](https://github.com/dakotalightning/niso/blob/master/CHANGELOG.md)
|
94
|
+
4. Make a pull request
|
95
|
+
|
87
96
|
## Credits
|
88
97
|
|
89
98
|
- This project is a hard fork of the proejct [niso](https://github.com/kenn/niso) by [kenn](https://github.com/kenn).
|
data/lib/niso/cli.rb
CHANGED
@@ -11,7 +11,7 @@ module Niso
|
|
11
11
|
do_create(project)
|
12
12
|
end
|
13
13
|
|
14
|
-
desc 'deploy [user@host:port] [role] [--sudo] or deploy
|
14
|
+
desc 'deploy [user@host:port] [role] [--sudo] or deploy do [name] [role] [--sudo]', 'Deploy niso project'
|
15
15
|
method_options :sudo => false
|
16
16
|
def deploy(first, *args)
|
17
17
|
do_deploy(first, *args)
|
@@ -23,12 +23,12 @@ module Niso
|
|
23
23
|
end
|
24
24
|
|
25
25
|
desc 'setup', 'Setup a new VM'
|
26
|
-
def setup(provider = "
|
26
|
+
def setup(provider = "do")
|
27
27
|
Niso::Cloud.new(self, provider).setup
|
28
28
|
end
|
29
29
|
|
30
30
|
desc 'teardown', 'Teardown an existing VM'
|
31
|
-
def teardown(provider = "
|
31
|
+
def teardown(provider = "do")
|
32
32
|
Niso::Cloud.new(self, provider).teardown
|
33
33
|
end
|
34
34
|
|
@@ -55,9 +55,9 @@ module Niso
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def do_deploy(first, *args)
|
58
|
-
if ['
|
58
|
+
if ['do'].include?(first)
|
59
59
|
@instance_attributes = YAML.load(File.read("#{first}/instances/#{args[0]}.yml"))
|
60
|
-
target = @instance_attributes[:
|
60
|
+
target = @instance_attributes[:networks]["v4"].first["ip_address"]
|
61
61
|
role = args[1]
|
62
62
|
else
|
63
63
|
target = first
|
@@ -115,7 +115,7 @@ module Niso
|
|
115
115
|
|
116
116
|
# Merge instance attributes
|
117
117
|
@config['attributes'] ||= {}
|
118
|
-
@config['attributes'].update(Hash[@instance_attributes.map{|k,v| [k.to_s, v] }]) if @instance_attributes
|
118
|
+
# @config['attributes'].update(Hash[@instance_attributes.map{|k,v| [k.to_s, v] }]) if @instance_attributes
|
119
119
|
|
120
120
|
# Break down attributes into individual files
|
121
121
|
(@config['attributes'] || {}).each {|key, value| create_file "compiled/attributes/#{key}", value }
|
@@ -22,22 +22,47 @@ module Niso
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# Choose an image
|
25
|
-
if @config[
|
26
|
-
|
27
|
-
|
25
|
+
if @config["image"]
|
26
|
+
@attributes[:image] = @config["image"]
|
27
|
+
say "using config image"
|
28
|
+
else
|
29
|
+
if @config['images_filter']
|
30
|
+
result = @client.images.all(type: @config['images_filter'])
|
31
|
+
result = result.select{|i| i.distribution.match Regexp.new(@config['images_filter'], Regexp::IGNORECASE) }
|
32
|
+
end
|
33
|
+
choose(:image, result)
|
28
34
|
end
|
29
|
-
choose(:image, result)
|
30
35
|
|
31
36
|
# Go ahead?
|
32
|
-
|
37
|
+
say " - name => #{@ui.color(@name, :blue, :bold)}"
|
38
|
+
@attributes.each do |k,v|
|
39
|
+
say " - #{k} => #{@ui.color(v, :blue, :bold)}"
|
40
|
+
end
|
41
|
+
if @config["private_networking"]
|
42
|
+
say " - private_networking => #{@ui.color(@config["private_networking"].to_s, :blue, :bold)}"
|
43
|
+
end
|
44
|
+
say " - account => #{@ui.color(@client_info.email, :blue, :bold)}"
|
45
|
+
moveon = ask("Are you ready to go ahead? (y/n) ", ['y','n'])
|
33
46
|
exit unless moveon == 'y'
|
34
47
|
|
35
48
|
ssh_keys = @client.ssh_keys.all.collect { |key| key.fingerprint }
|
36
49
|
|
37
50
|
# Create
|
38
51
|
say "creating a new droplet..."
|
39
|
-
droplet = ::DropletKit::Droplet.new(
|
40
|
-
|
52
|
+
droplet = ::DropletKit::Droplet.new(
|
53
|
+
name: @name,
|
54
|
+
region: @attributes[:region],
|
55
|
+
image: @attributes[:image],
|
56
|
+
size: @attributes[:size],
|
57
|
+
private_networking: @config["private_networking"],
|
58
|
+
ssh_keys: ssh_keys
|
59
|
+
)
|
60
|
+
|
61
|
+
begin
|
62
|
+
result = @client.droplets.create(droplet)
|
63
|
+
rescue ::DropletKit::FailedCreate => e
|
64
|
+
abort_with e.message
|
65
|
+
end
|
41
66
|
|
42
67
|
@droplet_id = result.id
|
43
68
|
say "Created a new droplet (id: #{@droplet_id}). Booting..."
|
@@ -47,18 +72,17 @@ module Niso
|
|
47
72
|
sleep 3
|
48
73
|
end
|
49
74
|
|
50
|
-
@networks = @client.droplets.find(id: @droplet_id).networks
|
51
|
-
say "Done.
|
75
|
+
@networks = @client.droplets.find(id: @droplet_id).networks.to_h.to_json
|
76
|
+
say "Done."
|
52
77
|
|
53
78
|
@instance = {
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:image_slug => @attributes[:image_slug],
|
79
|
+
droplet_id: @droplet_id,
|
80
|
+
env: @env,
|
81
|
+
name: @name,
|
82
|
+
networks: JSON.parse(@networks),
|
83
|
+
size: @attributes[:size],
|
84
|
+
region: @attributes[:region],
|
85
|
+
image: @attributes[:image],
|
62
86
|
}
|
63
87
|
end
|
64
88
|
|
@@ -66,7 +90,7 @@ module Niso
|
|
66
90
|
abort "no #{key} found!" if result.first.nil?
|
67
91
|
# result.each{|i| say "#{i.slug}" }
|
68
92
|
choices = result.map(&:slug).compact
|
69
|
-
@attributes[:"#{key}
|
93
|
+
@attributes[:"#{key}"] = ask_menu("which #{key}?: ", choices)
|
70
94
|
end
|
71
95
|
|
72
96
|
def do_teardown
|
@@ -80,9 +104,7 @@ module Niso
|
|
80
104
|
def setup_client
|
81
105
|
begin
|
82
106
|
@client = ::DropletKit::Client.new(access_token: @config['access_token'])
|
83
|
-
|
84
|
-
moveon = ask(" ... continue with #{info.email} account? (y/n) ", String) {|q| q.in = ['y','n']}
|
85
|
-
exit unless moveon == 'y'
|
107
|
+
@client_info = @client.account.info()
|
86
108
|
rescue ::DropletKit::Error => e
|
87
109
|
abort_with e.message
|
88
110
|
end
|
data/lib/niso/cloud.rb
CHANGED
data/niso.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'niso'
|
5
|
-
spec.version = '2.0.
|
5
|
+
spec.version = '2.0.4'
|
6
6
|
spec.authors = ['Dakota Lightning']
|
7
7
|
spec.email = ['im@koda.io']
|
8
8
|
spec.homepage = 'http://github.com/dakotalightning/niso'
|
9
9
|
spec.summary = %q{Server provisioning utility}
|
10
|
-
spec.description = %q{Server provisioning utility}
|
10
|
+
spec.description = %q{Fork of the sunzi project, Plugin based Server provisioning utility}
|
11
11
|
spec.license = 'MIT'
|
12
12
|
|
13
13
|
spec.files = `git ls-files`.split($/)
|
@@ -15,9 +15,11 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
-
spec.
|
19
|
-
|
20
|
-
spec.add_runtime_dependency '
|
21
|
-
spec.
|
22
|
-
spec.
|
18
|
+
spec.required_ruby_version = '>= 2.0.0'
|
19
|
+
|
20
|
+
spec.add_runtime_dependency 'thor', '~> 0.19'
|
21
|
+
spec.add_runtime_dependency 'rainbow', '~> 2.0'
|
22
|
+
spec.add_runtime_dependency 'net-ssh', '~> 3.2'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.5'
|
24
|
+
spec.add_development_dependency 'minitest', '~> 5.8'
|
23
25
|
end
|
metadata
CHANGED
@@ -1,86 +1,86 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: niso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dakota Lightning
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.19'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.19'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rainbow
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: net-ssh
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '10.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '10.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '5.8'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
83
|
-
description: Server provisioning utility
|
82
|
+
version: '5.8'
|
83
|
+
description: Fork of the sunzi project, Plugin based Server provisioning utility
|
84
84
|
email:
|
85
85
|
- im@koda.io
|
86
86
|
executables:
|
@@ -110,7 +110,7 @@ files:
|
|
110
110
|
- lib/templates/create/recipes/niso.sh
|
111
111
|
- lib/templates/create/roles/db.sh
|
112
112
|
- lib/templates/create/roles/web.sh
|
113
|
-
- lib/templates/setup/
|
113
|
+
- lib/templates/setup/do.yml
|
114
114
|
- niso.gemspec
|
115
115
|
- test/niso_test_dir/files/nginx/nginx.conf
|
116
116
|
- test/niso_test_dir/recipes/nginx.sh
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
128
128
|
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: 2.0.0
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
133
|
- - ">="
|