vmc 0.4.0.beta.8 → 0.4.0.beta.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/{vmc-ng/LICENSE → LICENSE} +0 -0
  2. data/{vmc-ng/Rakefile → Rakefile} +0 -0
  3. data/bin/vmc +10 -11
  4. data/{vmc-ng/lib → lib}/vmc/cli/app.rb +106 -58
  5. data/{vmc-ng/lib → lib}/vmc/cli/better_help.rb +0 -0
  6. data/{vmc-ng/lib → lib}/vmc/cli/command.rb +14 -0
  7. data/{vmc-ng/lib → lib}/vmc/cli/dots.rb +0 -0
  8. data/{vmc-ng/lib → lib}/vmc/cli/service.rb +0 -0
  9. data/{vmc-ng/lib → lib}/vmc/cli/user.rb +0 -0
  10. data/{vmc-ng/lib → lib}/vmc/cli.rb +88 -2
  11. data/{vmc-ng/lib → lib}/vmc/constants.rb +0 -0
  12. data/{vmc-ng/lib → lib}/vmc/detect.rb +0 -0
  13. data/{vmc-ng/lib → lib}/vmc/errors.rb +0 -0
  14. data/{vmc-ng/lib → lib}/vmc/plugin.rb +0 -0
  15. data/lib/vmc/version.rb +3 -0
  16. data/{vmc-ng/lib → lib}/vmc.rb +0 -0
  17. metadata +41 -273
  18. data/vmc/LICENSE +0 -24
  19. data/vmc/README.md +0 -102
  20. data/vmc/Rakefile +0 -101
  21. data/vmc/bin/vmc +0 -6
  22. data/vmc/caldecott_helper/Gemfile +0 -10
  23. data/vmc/caldecott_helper/Gemfile.lock +0 -48
  24. data/vmc/caldecott_helper/server.rb +0 -43
  25. data/vmc/config/clients.yml +0 -17
  26. data/vmc/config/micro/offline.conf +0 -2
  27. data/vmc/config/micro/paths.yml +0 -22
  28. data/vmc/config/micro/refresh_ip.rb +0 -20
  29. data/vmc/lib/cli/commands/admin.rb +0 -80
  30. data/vmc/lib/cli/commands/apps.rb +0 -1126
  31. data/vmc/lib/cli/commands/base.rb +0 -227
  32. data/vmc/lib/cli/commands/manifest.rb +0 -56
  33. data/vmc/lib/cli/commands/micro.rb +0 -115
  34. data/vmc/lib/cli/commands/misc.rb +0 -129
  35. data/vmc/lib/cli/commands/services.rb +0 -180
  36. data/vmc/lib/cli/commands/user.rb +0 -65
  37. data/vmc/lib/cli/config.rb +0 -173
  38. data/vmc/lib/cli/console_helper.rb +0 -160
  39. data/vmc/lib/cli/core_ext.rb +0 -122
  40. data/vmc/lib/cli/errors.rb +0 -19
  41. data/vmc/lib/cli/frameworks.rb +0 -265
  42. data/vmc/lib/cli/manifest_helper.rb +0 -302
  43. data/vmc/lib/cli/runner.rb +0 -531
  44. data/vmc/lib/cli/services_helper.rb +0 -84
  45. data/vmc/lib/cli/tunnel_helper.rb +0 -332
  46. data/vmc/lib/cli/usage.rb +0 -115
  47. data/vmc/lib/cli/version.rb +0 -7
  48. data/vmc/lib/cli/zip_util.rb +0 -77
  49. data/vmc/lib/cli.rb +0 -47
  50. data/vmc/lib/vmc/client.rb +0 -471
  51. data/vmc/lib/vmc/const.rb +0 -22
  52. data/vmc/lib/vmc/micro/switcher/base.rb +0 -97
  53. data/vmc/lib/vmc/micro/switcher/darwin.rb +0 -19
  54. data/vmc/lib/vmc/micro/switcher/dummy.rb +0 -15
  55. data/vmc/lib/vmc/micro/switcher/linux.rb +0 -16
  56. data/vmc/lib/vmc/micro/switcher/windows.rb +0 -31
  57. data/vmc/lib/vmc/micro/vmrun.rb +0 -158
  58. data/vmc/lib/vmc/micro.rb +0 -56
  59. data/vmc/lib/vmc.rb +0 -3
  60. data/vmc-ng/bin/vmc +0 -14
  61. data/vmc-ng/lib/vmc/version.rb +0 -3
@@ -1,48 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- addressable (2.2.6)
5
- async_sinatra (0.5.0)
6
- rack (>= 1.2.1)
7
- sinatra (>= 1.0)
8
- caldecott (0.0.3)
9
- addressable (= 2.2.6)
10
- async_sinatra (= 0.5.0)
11
- em-http-request (= 0.3.0)
12
- em-websocket (= 0.3.1)
13
- json (= 1.6.1)
14
- uuidtools (= 2.1.2)
15
- daemons (1.1.4)
16
- em-http-request (0.3.0)
17
- addressable (>= 2.0.0)
18
- escape_utils
19
- eventmachine (>= 0.12.9)
20
- em-websocket (0.3.1)
21
- addressable (>= 2.1.1)
22
- eventmachine (>= 0.12.9)
23
- escape_utils (0.2.4)
24
- eventmachine (0.12.10)
25
- json (1.6.1)
26
- rack (1.2.4)
27
- sinatra (1.2.7)
28
- rack (~> 1.1)
29
- tilt (>= 1.2.2, < 2.0)
30
- thin (1.2.11)
31
- daemons (>= 1.0.9)
32
- eventmachine (>= 0.12.6)
33
- rack (>= 1.0.0)
34
- tilt (1.3.3)
35
- uuidtools (2.1.2)
36
-
37
- PLATFORMS
38
- ruby
39
-
40
- DEPENDENCIES
41
- async_sinatra
42
- bundler
43
- caldecott (= 0.0.3)
44
- em-websocket
45
- json
46
- rack (~> 1.2.0)
47
- thin
48
- uuidtools
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Copyright (c) 2009-2011 VMware, Inc.
3
- $:.unshift(File.dirname(__FILE__) + '/lib')
4
-
5
- require 'rubygems'
6
- require 'bundler/setup'
7
-
8
- require 'caldecott'
9
- require 'sinatra'
10
- require 'json'
11
- require 'eventmachine'
12
-
13
- port = ENV['VMC_APP_PORT']
14
- port ||= 8081
15
-
16
- # add vcap specific stuff to Caldecott
17
- class VcapHttpTunnel < Caldecott::Server::HttpTunnel
18
- get '/info' do
19
- { "version" => '0.0.4' }.to_json
20
- end
21
-
22
- def self.get_tunnels
23
- super
24
- end
25
-
26
- get '/services' do
27
- services_env = ENV['VMC_SERVICES']
28
- return "no services env" if services_env.nil? or services_env.empty?
29
- services_env
30
- end
31
-
32
- get '/services/:service' do |service_name|
33
- services_env = ENV['VMC_SERVICES']
34
- not_found if services_env.nil?
35
-
36
- services = JSON.parse(services_env)
37
- service = services.find { |s| s["name"] == service_name }
38
- not_found if service.nil?
39
- service["options"].to_json
40
- end
41
- end
42
-
43
- VcapHttpTunnel.run!(:port => port, :auth_token => ENV["CALDECOTT_AUTH"])
@@ -1,17 +0,0 @@
1
- redis:
2
- redis-cli: -h ${host} -p ${port} -a ${password}
3
-
4
- mysql:
5
- mysql: --protocol=TCP --host=${host} --port=${port} --user=${user} --password=${password} ${name}
6
- mysqldump: --protocol=TCP --host=${host} --port=${port} --user=${user} --password=${password} ${name} > ${Output file}
7
-
8
- mongodb:
9
- mongo: --host ${host} --port ${port} -u ${user} -p ${password} ${name}
10
- mongodump: --host ${host} --port ${port} -u ${user} -p ${password} --db ${name}
11
- mongorestore: --host ${host} --port ${port} -u ${user} -p ${password} --db ${name} ${Directory or filename to restore from}
12
-
13
- postgresql:
14
- psql:
15
- command: -h ${host} -p ${port} -d ${name} -U ${user} -w
16
- environment:
17
- - PGPASSWORD='${password}'
@@ -1,2 +0,0 @@
1
- no-resolv
2
- log-queries
@@ -1,22 +0,0 @@
1
- darwin:
2
- vmrun:
3
- - "/Applications/VMware Fusion.app/Contents/Library/"
4
- - "/Applications/Fusion.app/Contents/Library/"
5
- vmx:
6
- - "~/Documents/Virtual Machines.localized/"
7
- - "~/Documents/Virtual Machines/"
8
- - "~/Desktop/"
9
-
10
- linux:
11
- vmrun:
12
- - "/usr/bin/"
13
- vmx:
14
- - "~/"
15
-
16
- windows:
17
- vmrun:
18
- - "c:\\Program Files (x86)\\"
19
- - "c:\\Program Files\\"
20
- vmx:
21
- - "~\\Documents\\"
22
- - "~\\Desktop\\"
@@ -1,20 +0,0 @@
1
- #!/var/vcap/bosh/bin/ruby
2
- require 'socket'
3
-
4
- A_ROOT_SERVER = '198.41.0.4'
5
-
6
- begin
7
- retries ||= 0
8
- route ||= A_ROOT_SERVER
9
- orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true
10
- ip_address = UDPSocket.open {|s| s.connect(route, 1); s.addr.last }
11
- rescue Errno::ENETUNREACH
12
- # happens on boot when dhcp hasn't completed when we get here
13
- sleep 3
14
- retries += 1
15
- retry if retries < 10
16
- ensure
17
- Socket.do_not_reverse_lookup = orig
18
- end
19
-
20
- File.open("/tmp/ip.txt", 'w') { |file| file.write(ip_address) }
@@ -1,80 +0,0 @@
1
- module VMC::Cli::Command
2
-
3
- class Admin < Base
4
-
5
- def list_users
6
- users = client.users
7
- users.sort! {|a, b| a[:email] <=> b[:email] }
8
- return display JSON.pretty_generate(users || []) if @options[:json]
9
-
10
- display "\n"
11
- return display "No Users" if users.nil? || users.empty?
12
-
13
- users_table = table do |t|
14
- t.headings = 'Email', 'Admin', 'Apps'
15
- users.each do |user|
16
- t << [user[:email], user[:admin], user[:apps].map {|x| x[:name]}.join(', ')]
17
- end
18
- end
19
- display users_table
20
- end
21
-
22
- alias :users :list_users
23
-
24
- def add_user(email=nil)
25
- email ||= @options[:email]
26
- email ||= ask("Email") unless no_prompt
27
- password = @options[:password]
28
- unless no_prompt || password
29
- password = ask("Password", :echo => "*")
30
- password2 = ask("Verify Password", :echo => "*")
31
- err "Passwords did not match, try again" if password != password2
32
- end
33
- err "Need a valid email" unless email
34
- err "Need a password" unless password
35
- display 'Creating New User: ', false
36
- client.add_user(email, password)
37
- display 'OK'.green
38
-
39
- # if we are not logged in for the current target, log in as the new user
40
- return unless VMC::Cli::Config.auth_token.nil?
41
- @options[:password] = password
42
- cmd = User.new(@options)
43
- cmd.login(email)
44
- end
45
-
46
- def delete_user(user_email)
47
- # Check to make sure all apps and services are deleted before deleting the user
48
- # implicit proxying
49
-
50
- client.proxy_for(user_email)
51
- @options[:proxy] = user_email
52
- apps = client.apps
53
-
54
- if (apps && !apps.empty?)
55
- unless no_prompt
56
- proceed = ask(
57
- "\nDeployed applications and associated services will be DELETED, continue?",
58
- :default => false
59
- )
60
- err "Aborted" unless proceed
61
- end
62
- cmd = Apps.new(@options.merge({ :force => true }))
63
- apps.each { |app| cmd.delete(app[:name]) }
64
- end
65
-
66
- services = client.services
67
- if (services && !services.empty?)
68
- cmd = Services.new(@options)
69
- services.each { |s| cmd.delete_service(s[:name])}
70
- end
71
-
72
- display 'Deleting User: ', false
73
- client.proxy = nil
74
- client.delete_user(user_email)
75
- display 'OK'.green
76
- end
77
-
78
- end
79
-
80
- end