vikingio 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +22 -22
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -22
- data/README.md +13 -13
- data/Rakefile +2 -2
- data/bin/vikingio +10 -5
- data/dlls/VikingIO.Network.Client.dll +0 -0
- data/dlls/VikingIO.Network.dll +0 -0
- data/lib/vikingio/cli/client.rb +157 -153
- data/lib/vikingio/cli/commands.rb +512 -467
- data/lib/vikingio/cli/helpers.rb +115 -110
- data/lib/vikingio/cli/version.rb +5 -5
- data/lib/vikingio/cli.rb +49 -44
- data/templates/MessageTemplate.cs +25 -25
- data/templates/NetworkManager.cs +33 -33
- data/templates/Program.cs +21 -21
- data/templates/ServerNodeTemplate.cs +39 -39
- data/templates/VikingIO.Config.cs +8 -8
- data/vikingio-cli.gemspec +23 -23
- 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: 5959b8f07fca2207bc45c91b131c001286a97c7d
|
4
|
+
data.tar.gz: 988b3cae379904c96f908492cb58a2cd6f3ad1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 446b5231e205e200834d711492f0bdd0d521b6c6c45a0b42c7a720160df7792194fcde44ac204c0b68e9ffa628a4204cc8e40fbe520be6b53fc694535ffc9eb0
|
7
|
+
data.tar.gz: 5f6046bf32913927037bbc1db8b8f0e5bab8fd5c64618415f121d0bf00f27c04e8dafcc1740aaa90d4a7e4230a500a9ed5f04f96396fce4b367ea68e1e7ccfa0
|
data/.gitignore
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in vikingio-cli.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in vikingio-cli.gemspec
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2014 Eric Campbell
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2014 Eric Campbell
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
Command Line Toolkit for VikingIO. Sign up at http://www.vikingio.com
|
2
|
-
|
3
|
-
Commands:
|
4
|
-
|
5
|
-
help -
|
6
|
-
login - Authenticate with VikingIO
|
7
|
-
logout - Clear your authentication credentials
|
8
|
-
create - Create a new VikingIO application
|
9
|
-
generate - Generate a skeleton VikingIO application
|
10
|
-
link - Link the current directory with an existing VikingIO application
|
11
|
-
unlink - Unlink the current directory with it's VikingIO application
|
12
|
-
deploy - Deploy your application
|
13
|
-
shutdown - Shutdown all production servers
|
1
|
+
Command Line Toolkit for VikingIO. Sign up at http://www.vikingio.com
|
2
|
+
|
3
|
+
Commands:
|
4
|
+
|
5
|
+
help -
|
6
|
+
login - Authenticate with VikingIO
|
7
|
+
logout - Clear your authentication credentials
|
8
|
+
create - Create a new VikingIO application
|
9
|
+
generate - Generate a skeleton VikingIO application
|
10
|
+
link - Link the current directory with an existing VikingIO application
|
11
|
+
unlink - Unlink the current directory with it's VikingIO application
|
12
|
+
deploy - Deploy your application
|
13
|
+
shutdown - Shutdown all production servers
|
14
14
|
run - Compile and run your application locally
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
data/bin/vikingio
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
|
4
|
-
#
|
5
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
#puts $LOAD_PATH
|
5
|
+
|
6
|
+
lib = File.expand_path(File.join(File.dirname(File.expand_path(__FILE__)), "..", "lib"))
|
7
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
8
|
+
|
9
|
+
# start up the CLI
|
10
|
+
require "vikingio/cli"
|
6
11
|
VikingIO::CLI.start(*ARGV)
|
File without changes
|
data/dlls/VikingIO.Network.dll
CHANGED
File without changes
|
data/lib/vikingio/cli/client.rb
CHANGED
@@ -1,153 +1,157 @@
|
|
1
|
-
module VikingIO
|
2
|
-
module CLI
|
3
|
-
module Client
|
4
|
-
|
5
|
-
BASE_PATH = "https://www.vikingio.com/api/"
|
6
|
-
BASE_BUILD_PATH = "http://build1.vikingio.com/"
|
7
|
-
|
8
|
-
def self.get_status(user_key, app_key)
|
9
|
-
uri = URI.join(BASE_PATH, "apps/status")
|
10
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
11
|
-
http.use_ssl = true
|
12
|
-
|
13
|
-
req
|
14
|
-
req['x-vikingio-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
req
|
24
|
-
req['x-vikingio-key'] =
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
req
|
35
|
-
req['x-vikingio-key'] =
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
req
|
46
|
-
req['x-vikingio-key'] =
|
47
|
-
req['x-vikingio-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
req
|
57
|
-
req['x-vikingio-key'] =
|
58
|
-
req['x-vikingio-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
req
|
69
|
-
req['x-vikingio-key'] =
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
req
|
78
|
-
req['x-vikingio-key'] =
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
req
|
90
|
-
req['x-vikingio-key'] =
|
91
|
-
req['x-vikingio-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
http
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
return
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
end
|
1
|
+
module VikingIO
|
2
|
+
module CLI
|
3
|
+
module Client
|
4
|
+
|
5
|
+
BASE_PATH = "https://www.vikingio.com/api/"
|
6
|
+
BASE_BUILD_PATH = "http://build1.vikingio.com/"
|
7
|
+
|
8
|
+
def self.get_status(user_key, app_key)
|
9
|
+
uri = URI.join(BASE_PATH, "apps/status")
|
10
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
11
|
+
http.use_ssl = true
|
12
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
13
|
+
req = Net::HTTP::Get.new(uri.path)
|
14
|
+
req['x-vikingio-user-key'] = user_key
|
15
|
+
req['x-vikingio-app-key'] = app_key
|
16
|
+
resp = http.request(req)
|
17
|
+
return JSON.parse(resp.body)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.deploy_data(user_key, app_key, data_path)
|
21
|
+
uri = URI.join(BASE_BUILD_PATH, "deploy_data")
|
22
|
+
|
23
|
+
req = Net::HTTP::Post::Multipart.new uri.path, {"file" => UploadIO.new(data_path, "application/octet-stream")}
|
24
|
+
req['x-vikingio-user-key'] = user_key
|
25
|
+
req['x-vikingio-key'] = app_key
|
26
|
+
res = Net::HTTP.start(uri.host, uri.port) do |http|
|
27
|
+
http.request(req)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.deploy_servers(user_key, app_key, server_path)
|
32
|
+
uri = URI.join(BASE_BUILD_PATH, "deploy_servers")
|
33
|
+
|
34
|
+
req = Net::HTTP::Post::Multipart.new uri.path, {"file" => UploadIO.new(server_path, "application/octet-stream")}
|
35
|
+
req['x-vikingio-user-key'] = user_key
|
36
|
+
req['x-vikingio-key'] = app_key
|
37
|
+
res = Net::HTTP.start(uri.host, uri.port) do |http|
|
38
|
+
http.request(req)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.deploy_check(user_key, app_key)
|
43
|
+
uri = URI.join(BASE_BUILD_PATH, "deploy_check")
|
44
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
45
|
+
req = Net::HTTP::Get.new(uri.path)
|
46
|
+
req['x-vikingio-user-key'] = user_key
|
47
|
+
req['x-vikingio-key'] = app_key
|
48
|
+
req['x-vikingio-nodefile'] = VikingIO::CLI.get_node_data.to_json
|
49
|
+
resp = http.request(req)
|
50
|
+
return resp.body
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.deploy(user_key, app_key)
|
54
|
+
uri = URI.join(BASE_BUILD_PATH, "deploy")
|
55
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
56
|
+
req = Net::HTTP::Get.new(uri.path)
|
57
|
+
req['x-vikingio-user-key'] = user_key
|
58
|
+
req['x-vikingio-key'] = app_key
|
59
|
+
req['x-vikingio-nodefile'] = VikingIO::CLI.get_node_data.to_json
|
60
|
+
resp = http.request(req)
|
61
|
+
return resp.body
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.request_build_job(user_key, app_key)
|
65
|
+
uri = URI.join(BASE_BUILD_PATH, "start")
|
66
|
+
|
67
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
68
|
+
req = Net::HTTP::Get.new(uri.path)
|
69
|
+
req['x-vikingio-user-key'] = user_key
|
70
|
+
req['x-vikingio-key'] = app_key
|
71
|
+
http.request(req)
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.synchronize_file(user_key, app_key, file)
|
75
|
+
uri = URI.join(BASE_BUILD_PATH, "sync")
|
76
|
+
|
77
|
+
req = Net::HTTP::Post::Multipart.new uri.path, {"file" => UploadIO.new(file, "application/octet-stream"), "build-rfname" => file.gsub(File.join(Dir.pwd, "VikingIO"), "")}
|
78
|
+
req['x-vikingio-user-key'] = user_key
|
79
|
+
req['x-vikingio-key'] = app_key
|
80
|
+
res = Net::HTTP.start(uri.host, uri.port) do |http|
|
81
|
+
http.request(req)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.compile_server(user_key, app_key, app_name)
|
86
|
+
uri = URI.join(BASE_BUILD_PATH, "compile")
|
87
|
+
|
88
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
89
|
+
req = Net::HTTP::Get.new(uri.path)
|
90
|
+
req['x-vikingio-user-key'] = user_key
|
91
|
+
req['x-vikingio-key'] = app_key
|
92
|
+
req['x-vikingio-app-name'] = app_name
|
93
|
+
resp = http.request(req)
|
94
|
+
|
95
|
+
puts resp.body
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.authenticate(email, password)
|
99
|
+
uri = URI.join(BASE_PATH, "auth")
|
100
|
+
|
101
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
102
|
+
http.use_ssl = true
|
103
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
104
|
+
|
105
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
106
|
+
request.set_form_data({"email" => email, "password" => password})
|
107
|
+
|
108
|
+
response = http.request(request)
|
109
|
+
|
110
|
+
return nil if response.code == "403"
|
111
|
+
puts "Unable to reach server." and return nil if response.code == "401"
|
112
|
+
|
113
|
+
json = JSON.parse(response.body)
|
114
|
+
|
115
|
+
return json["key"]
|
116
|
+
end
|
117
|
+
|
118
|
+
def self.create_app(name)
|
119
|
+
uri = URI.join(BASE_PATH, "apps")
|
120
|
+
|
121
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
122
|
+
http.use_ssl = true
|
123
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
124
|
+
req = Net::HTTP::Post.new(uri.path)
|
125
|
+
req['x-vikingio-user-key'] = VikingIO::CLI.get_netrc_key
|
126
|
+
req.set_form_data({"name" => name})
|
127
|
+
response = http.request(req)
|
128
|
+
|
129
|
+
return nil if response.code == "403"
|
130
|
+
puts "Unable to reach server." and return nil if response.code == "401"
|
131
|
+
|
132
|
+
return JSON.parse(response.body)
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.create_node(name, app_key)
|
136
|
+
return nil if name == "" || name == nil
|
137
|
+
|
138
|
+
uri = URI.join(BASE_PATH, "nodes")
|
139
|
+
|
140
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
141
|
+
http.use_ssl = true
|
142
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
143
|
+
req = Net::HTTP::Post.new(uri.path)
|
144
|
+
req['x-vikingio-user-key'] = VikingIO::CLI.get_netrc_key
|
145
|
+
req['x-vikingio-app-key'] = app_key
|
146
|
+
req.set_form_data({"name" => name})
|
147
|
+
response = http.request(req)
|
148
|
+
|
149
|
+
return nil if response.code == "403"
|
150
|
+
puts "Unable to reach server." and return nil if response.code == "401"
|
151
|
+
|
152
|
+
return JSON.parse(response.body)
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|