magellan-cli 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/magellan/cli/base.rb +4 -1
- data/lib/magellan/cli/command.rb +5 -1
- data/lib/magellan/cli/http.rb +1 -1
- data/lib/magellan/cli/login.rb +1 -1
- data/lib/magellan/cli/resources/client_version.rb +1 -0
- data/lib/magellan/cli/resources/cloudsql.rb +1 -0
- data/lib/magellan/cli/resources/organization.rb +1 -0
- data/lib/magellan/cli/resources/project.rb +1 -0
- data/lib/magellan/cli/resources/stage.rb +17 -2
- data/lib/magellan/cli/resources/team.rb +1 -0
- data/lib/magellan/cli/resources/transaction_router.rb +1 -0
- data/lib/magellan/cli/resources/worker.rb +1 -0
- data/lib/magellan/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81d4181816437b398636b67acff42a17e42c7612
|
4
|
+
data.tar.gz: 3cb4698e4a1d55bcdeb0559514e6e26c24b073e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19759caaf922e87d3a05f047c5ab79fa51a007d64091ab499c763f15b10f08f9fa32b9db3e41b684b12579bbaa57a966a18e01c32f5a27cb47155a3e017a93a7
|
7
|
+
data.tar.gz: 293f9e67ef749634533897c7562aef3a2f3fb3a439ad0627d232ff588256a41ddd8408cc3a1f5f868a3f14d2a5d492a4f7347ecc516e95830baa17450a466d07
|
data/Gemfile.lock
CHANGED
data/lib/magellan/cli/base.rb
CHANGED
data/lib/magellan/cli/command.rb
CHANGED
@@ -6,7 +6,6 @@ require 'active_support/core_ext/string/inflections'
|
|
6
6
|
module Magellan
|
7
7
|
module Cli
|
8
8
|
class Command < Base
|
9
|
-
|
10
9
|
{
|
11
10
|
"organization" => "Organization",
|
12
11
|
"team" => "Team",
|
@@ -36,6 +35,11 @@ module Magellan
|
|
36
35
|
|
37
36
|
Magellan::Cli::Http.new.login!(email, password)
|
38
37
|
end
|
38
|
+
|
39
|
+
desc "version", "show version"
|
40
|
+
def version
|
41
|
+
$stdout.puts Magellan::Cli::VERSION
|
42
|
+
end
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
data/lib/magellan/cli/http.rb
CHANGED
data/lib/magellan/cli/login.rb
CHANGED
@@ -31,7 +31,7 @@ module Magellan
|
|
31
31
|
# @param [Hash] options オプション
|
32
32
|
# @option options [String] :api_version APIのバージョン。デフォルトは "1.0.0"
|
33
33
|
def initialize(base_url_or_host = nil, options = {})
|
34
|
-
base_url_or_host ||= (ENV["MAGELLAN_SITE"] || "
|
34
|
+
base_url_or_host ||= (ENV["MAGELLAN_SITE"] || "https://api-asia.magellanic-clouds.com")
|
35
35
|
if base_url_or_host =~ URI.regexp
|
36
36
|
@base_url = base_url_or_host.sub(/\/\Z/, '')
|
37
37
|
uri = URI.parse(@base_url)
|
@@ -28,6 +28,7 @@ module Magellan
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
post_json("/admin/#{resource_name}/new.json", params)
|
31
|
+
select(name)
|
31
32
|
end
|
32
33
|
|
33
34
|
desc "select NAME", "select Stage named by NAME"
|
@@ -106,8 +107,8 @@ module Magellan
|
|
106
107
|
def release_now
|
107
108
|
spacer = "\r" << (" " * 20)
|
108
109
|
print "\rrelease starting"
|
109
|
-
|
110
|
-
id =
|
110
|
+
stage = load_selection("stage")
|
111
|
+
id = stage["id"]
|
111
112
|
res0 = post_json("/admin/stage~title/#{id}/simple_method_call.json", {method_name: "release_now"})
|
112
113
|
res1 = res0["result"]
|
113
114
|
if res1
|
@@ -140,6 +141,7 @@ module Magellan
|
|
140
141
|
when "completed"
|
141
142
|
print spacer
|
142
143
|
puts "\r#{st}"
|
144
|
+
reload
|
143
145
|
return
|
144
146
|
when "aborted" then
|
145
147
|
print spacer
|
@@ -173,6 +175,19 @@ module Magellan
|
|
173
175
|
i = load_selection("container_image")
|
174
176
|
post_json("/admin/stage~version/#{v["id"]}/set_container_num.json", { container_num: num, container_image_id: i["id"] })
|
175
177
|
end
|
178
|
+
|
179
|
+
desc "reload", "reload last selections"
|
180
|
+
def reload
|
181
|
+
s = load_selection("stage")
|
182
|
+
select(s["name"])
|
183
|
+
[Worker, Image, Container].each do |klass|
|
184
|
+
s = (load_selections || {})[klass.parameter_name]
|
185
|
+
next unless s
|
186
|
+
name = s["name"]
|
187
|
+
next unless name
|
188
|
+
klass.new.select(name)
|
189
|
+
end
|
190
|
+
end
|
176
191
|
end
|
177
192
|
|
178
193
|
end
|
data/lib/magellan/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magellan-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm2000
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|