capdocker 1.0.61 → 1.0.62
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/capdocker.gemspec +1 -1
- data/lib/auth.rb +10 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43ea5ddbb9ad363c48a4879796c083253286886b
|
4
|
+
data.tar.gz: 43e35f9aa95ec89e18d20dc50449aabb4747fe9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735c3e6983ad3d7323bbdaeedea22485677c8204277ea6a185cab092b385e30dae1862f8943c4dccd04a2275b99ea92c952b25c8e62a33aa20c39df75edfd1b6
|
7
|
+
data.tar.gz: 314450e10ccdf973fdf8df55d903dc067be807fd246461594328ce02fa7bde033b06028713e4a76e2892816d665292b5f28f21bc38a46a767cbc33b3d5a62ccf
|
data/capdocker.gemspec
CHANGED
data/lib/auth.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'open-uri'
|
2
1
|
require 'json'
|
3
2
|
require 'netrc'
|
3
|
+
require 'net/http'
|
4
4
|
|
5
5
|
Capistrano::Configuration.instance(:must_exist).load do
|
6
6
|
|
@@ -16,7 +16,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
16
16
|
if !n[auth_base]
|
17
17
|
user = Capistrano::CLI.ui.ask("Account Name: ")
|
18
18
|
tok =Capistrano::CLI.ui.ask("Account Token: ")
|
19
|
-
result = JSON.parse(
|
19
|
+
result = JSON.parse(
|
20
|
+
Net::HTTP.get_response("http://#{auth_base}/account/auth/?account=#{user}&token=#{tok}")
|
21
|
+
)
|
20
22
|
n[auth_base] = result["success"], result["token"]
|
21
23
|
n.save
|
22
24
|
end
|
@@ -29,14 +31,18 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
29
31
|
desc "After a successful login, connect to the deploy server and receive deploy information"
|
30
32
|
task :get_deploy do
|
31
33
|
login
|
32
|
-
result = JSON.parse(
|
34
|
+
result = JSON.parse(
|
35
|
+
Net::HTTP("http://#{auth_base}/account/appinfo/?account=#{auth_account}&token=#{auth_token}&app=#{application}")
|
36
|
+
)
|
33
37
|
setup_app if result["error"]
|
34
38
|
end
|
35
39
|
|
36
40
|
desc "After a successful login, connect to the deploy server and receive deploy information"
|
37
41
|
task :setup_app do
|
38
42
|
login
|
39
|
-
result = JSON.parse(
|
43
|
+
result = JSON.parse(
|
44
|
+
Net::HTTP.post_form("http://#{auth_base}/account/appcreate/?account=#{auth_account}&token=#{auth_token}", 'app' => application)
|
45
|
+
)
|
40
46
|
puts result
|
41
47
|
end
|
42
48
|
|