shelly 0.5.3 → 0.5.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/CHANGELOG.md +7 -0
- data/lib/shelly/cli/endpoint.rb +1 -1
- data/lib/shelly/cli/main.rb +0 -38
- data/lib/shelly/cli/main/add.rb +56 -18
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/main_spec.rb +17 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa55d8fb185ab635a3242a8728cf151b252f04ba
|
4
|
+
data.tar.gz: e2cb634ae3e3bd10913044564c6d74734876f39a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd8b23f3f24a86d7a0b981dde92d7cdc199720de9a5aadef94006feac6b8bc6ad12f2796cf738c09d3fa6abcf3dd324a1f553e0a0f5cdf875e37e4caecbeca9
|
7
|
+
data.tar.gz: e0f9432da5457a0414550f54f12fc7c7e937cebcbd576622ce5d3099832394aa2166b378b6b3fe3fc64ce88e66b2826fffbc48899efdfc2ea0e7e7bb915877b6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 0.5.4 / 2015-02-19
|
2
|
+
|
3
|
+
* [improvement] Print organization / region list only one time on creating new
|
4
|
+
cloud
|
5
|
+
* [bugfix] Added information about default region while creating new cloud
|
6
|
+
* [bugfix] Use unordered list in choosing organization and region
|
7
|
+
|
1
8
|
## 0.5.3 / 2015-02-15
|
2
9
|
|
3
10
|
* [bugfix] Don't ask user about assigning new ip address on creating new
|
data/lib/shelly/cli/endpoint.rb
CHANGED
@@ -190,7 +190,7 @@ module Shelly
|
|
190
190
|
cli.options = {:cloud => app}
|
191
191
|
cli.list
|
192
192
|
say_new_line
|
193
|
-
question =
|
193
|
+
question = if sni
|
194
194
|
"You already have assigned endpoint(s). Are you sure you" \
|
195
195
|
" want to create another one with SNI? (yes/no):"
|
196
196
|
else
|
data/lib/shelly/cli/main.rb
CHANGED
@@ -480,44 +480,6 @@ Wait until cloud is in 'turned off' state and try again.}
|
|
480
480
|
end
|
481
481
|
end
|
482
482
|
|
483
|
-
def ask_for_code_name
|
484
|
-
default_code_name = default_name_from_dir_name
|
485
|
-
code_name = ask("Cloud code name (#{default_code_name} - default):")
|
486
|
-
code_name.blank? ? default_code_name : code_name
|
487
|
-
end
|
488
|
-
|
489
|
-
def ask_for_databases
|
490
|
-
kinds = Shelly::App::DATABASE_CHOICES
|
491
|
-
databases = ask("Which databases do you want to use " \
|
492
|
-
"#{kinds.join(", ")} (postgresql - default):")
|
493
|
-
begin
|
494
|
-
databases = databases.split(/[\s,]/).reject(&:blank?)
|
495
|
-
valid = valid_databases?(databases)
|
496
|
-
break if valid
|
497
|
-
databases = ask("Unknown database kind. Supported are: #{kinds.join(", ")}:")
|
498
|
-
end while not valid
|
499
|
-
|
500
|
-
databases.empty? ? ["postgresql"] : databases
|
501
|
-
end
|
502
|
-
|
503
|
-
def info_adding_cloudfile_to_repository
|
504
|
-
say_new_line
|
505
|
-
say "Project is now configured for use with Shelly Cloud:", :green
|
506
|
-
say "You can review changes using", :green
|
507
|
-
say " git status"
|
508
|
-
end
|
509
|
-
|
510
|
-
def info_deploying_to_shellycloud(remote = 'shelly')
|
511
|
-
say_new_line
|
512
|
-
say "When you make sure all settings are correct, add changes to your repository:", :green
|
513
|
-
say " git add ."
|
514
|
-
say ' git commit -m "Application added to Shelly Cloud"'
|
515
|
-
say_new_line
|
516
|
-
say "Deploy to your cloud using:", :green
|
517
|
-
say " git push #{remote} master"
|
518
|
-
say_new_line
|
519
|
-
end
|
520
|
-
|
521
483
|
def upload_ssh_key(given_key_path = nil)
|
522
484
|
user = Shelly::User.new
|
523
485
|
ssh_key = given_key_path ? Shelly::SshKey.new(given_key_path) : user.ssh_key
|
data/lib/shelly/cli/main/add.rb
CHANGED
@@ -79,6 +79,44 @@ module Shelly
|
|
79
79
|
end
|
80
80
|
|
81
81
|
no_tasks do
|
82
|
+
def ask_for_code_name
|
83
|
+
default_code_name = default_name_from_dir_name
|
84
|
+
code_name = ask("Cloud code name (#{default_code_name} - default):")
|
85
|
+
code_name.blank? ? default_code_name : code_name
|
86
|
+
end
|
87
|
+
|
88
|
+
def ask_for_databases
|
89
|
+
kinds = Shelly::App::DATABASE_CHOICES
|
90
|
+
databases = ask("Which databases do you want to use " \
|
91
|
+
"#{kinds.join(", ")} (postgresql - default):")
|
92
|
+
begin
|
93
|
+
databases = databases.split(/[\s,]/).reject(&:blank?)
|
94
|
+
valid = valid_databases?(databases)
|
95
|
+
break if valid
|
96
|
+
databases = ask("Unknown database kind. Supported are: #{kinds.join(", ")}:")
|
97
|
+
end while not valid
|
98
|
+
|
99
|
+
databases.empty? ? ["postgresql"] : databases
|
100
|
+
end
|
101
|
+
|
102
|
+
def info_adding_cloudfile_to_repository
|
103
|
+
say_new_line
|
104
|
+
say "Project is now configured for use with Shelly Cloud:", :green
|
105
|
+
say "You can review changes using", :green
|
106
|
+
say " git status"
|
107
|
+
end
|
108
|
+
|
109
|
+
def info_deploying_to_shellycloud(remote = 'shelly')
|
110
|
+
say_new_line
|
111
|
+
say "When you make sure all settings are correct, add changes to your repository:", :green
|
112
|
+
say " git add ."
|
113
|
+
say ' git commit -m "Application added to Shelly Cloud"'
|
114
|
+
say_new_line
|
115
|
+
say "Deploy to your cloud using:", :green
|
116
|
+
say " git push #{remote} master"
|
117
|
+
say_new_line
|
118
|
+
end
|
119
|
+
|
82
120
|
def ask_for_organization(options)
|
83
121
|
organizations = Shelly::User.new.organizations
|
84
122
|
|
@@ -88,16 +126,14 @@ module Shelly
|
|
88
126
|
say "Select organization for this cloud:"
|
89
127
|
say_new_line
|
90
128
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
organizations.each_with_index do |organization, i|
|
95
|
-
print_wrapped "#{i + 1}) #{organization.name}", :ident => 2
|
96
|
-
end
|
129
|
+
organizations.each do |organization|
|
130
|
+
print_wrapped "\u2219 #{organization.name}", :ident => 2
|
131
|
+
end
|
97
132
|
|
98
|
-
|
99
|
-
|
133
|
+
say green "Or leave empty to create a new organization"
|
134
|
+
say_new_line
|
100
135
|
|
136
|
+
loop do
|
101
137
|
selected = ask("Organization:")
|
102
138
|
if organizations.select { |o| o.name == selected }.present?
|
103
139
|
return selected
|
@@ -105,8 +141,8 @@ module Shelly
|
|
105
141
|
say_new_line
|
106
142
|
return ask_for_new_organization(options)
|
107
143
|
else
|
108
|
-
say_new_line
|
109
144
|
say_warning "#{selected} organization does not exist"
|
145
|
+
say_new_line
|
110
146
|
end
|
111
147
|
end
|
112
148
|
end
|
@@ -124,23 +160,25 @@ module Shelly
|
|
124
160
|
|
125
161
|
def ask_for_region
|
126
162
|
regions = Shelly::App::REGIONS
|
127
|
-
say "Select region for this cloud:"
|
128
163
|
say_new_line
|
129
164
|
|
130
|
-
|
131
|
-
|
165
|
+
say "Select region for this cloud:"
|
166
|
+
say_new_line
|
132
167
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
168
|
+
regions.each do |region|
|
169
|
+
print_wrapped "\u2219 #{region}", :ident => 2
|
170
|
+
end
|
171
|
+
say_new_line
|
137
172
|
|
138
|
-
|
173
|
+
loop do
|
174
|
+
selected = ask("Region (EU - default):").upcase
|
139
175
|
if regions.include?(selected)
|
140
176
|
return selected
|
177
|
+
elsif selected.empty?
|
178
|
+
return "EU"
|
141
179
|
else
|
142
|
-
say_new_line
|
143
180
|
say_warning "#{selected} region is not available"
|
181
|
+
say_new_line
|
144
182
|
end
|
145
183
|
end
|
146
184
|
end
|
data/lib/shelly/version.rb
CHANGED
@@ -640,11 +640,10 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
640
640
|
|
641
641
|
it "should ask user to choose organization" do
|
642
642
|
$stdout.should_receive(:puts).
|
643
|
-
|
644
|
-
$stdout.should_receive(:puts).with("
|
645
|
-
$stdout.should_receive(:puts).with(" 1) aaa")
|
643
|
+
with("Select organization for this cloud:")
|
644
|
+
$stdout.should_receive(:puts).with(" \u2219 aaa")
|
646
645
|
$stdout.should_receive(:puts).
|
647
|
-
|
646
|
+
with(green "Or leave empty to create a new organization")
|
648
647
|
$stdout.should_receive(:print).with("Organization: ")
|
649
648
|
fake_stdin(["foo", "none", "aaa"]) do
|
650
649
|
invoke(@main, :add)
|
@@ -732,10 +731,9 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
732
731
|
it "should ask user to choose the region" do
|
733
732
|
@app.should_receive(:region=).with("NA")
|
734
733
|
$stdout.should_receive(:puts).with("Select region for this cloud:")
|
735
|
-
$stdout.should_receive(:puts).with("
|
736
|
-
$stdout.should_receive(:puts).with("
|
737
|
-
$stdout.should_receive(:
|
738
|
-
$stdout.should_receive(:print).with("Region: ")
|
734
|
+
$stdout.should_receive(:puts).with(" \u2219 EU")
|
735
|
+
$stdout.should_receive(:puts).with(" \u2219 NA")
|
736
|
+
$stdout.should_receive(:print).with("Region (EU - default): ")
|
739
737
|
fake_stdin(["foo", "none", "NA"]) do
|
740
738
|
invoke(@main, :add)
|
741
739
|
end
|
@@ -745,11 +743,21 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
745
743
|
it "should print a warning message and ask again" do
|
746
744
|
$stdout.should_receive(:puts).
|
747
745
|
with(yellow "ASIA region is not available")
|
748
|
-
|
746
|
+
@app.should_not_receive(:region=).with("ASIA")
|
747
|
+
@app.should_receive(:region=).with("NA")
|
749
748
|
fake_stdin(["foo", "none", "ASIA", "NA"]) do
|
750
749
|
invoke(@main, :add)
|
751
750
|
end
|
752
751
|
end
|
752
|
+
|
753
|
+
context "and empty string was on the input" do
|
754
|
+
it "should assign EU region by default" do
|
755
|
+
@app.should_receive(:region=).with("EU")
|
756
|
+
fake_stdin(["foo", "none", ""]) do
|
757
|
+
invoke(@main, :add)
|
758
|
+
end
|
759
|
+
end
|
760
|
+
end
|
753
761
|
end
|
754
762
|
|
755
763
|
context "when given region does not accepts new apps" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shelly Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
359
|
version: '0'
|
360
360
|
requirements: []
|
361
361
|
rubyforge_project: shelly
|
362
|
-
rubygems_version: 2.4.
|
362
|
+
rubygems_version: 2.4.6
|
363
363
|
signing_key:
|
364
364
|
specification_version: 4
|
365
365
|
summary: Shelly Cloud command line tool
|