rhc 0.92.11 → 0.93.18

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.
Files changed (55) hide show
  1. data/README.md +1 -9
  2. data/Rakefile +1 -55
  3. data/bin/rhc +31 -1
  4. data/bin/rhc-app +62 -127
  5. data/bin/rhc-chk +6 -7
  6. data/bin/rhc-create-app +8 -8
  7. data/bin/rhc-create-domain +6 -86
  8. data/bin/rhc-ctl-app +3 -3
  9. data/bin/rhc-ctl-domain +4 -4
  10. data/bin/rhc-domain +16 -18
  11. data/bin/rhc-domain-info +3 -3
  12. data/bin/rhc-port-forward +127 -24
  13. data/bin/rhc-snapshot +7 -46
  14. data/bin/rhc-sshkey +13 -79
  15. data/bin/rhc-tail-files +16 -8
  16. data/lib/rhc-common.rb +406 -230
  17. data/lib/rhc-rest.rb +3 -3
  18. data/lib/rhc-rest/client.rb +1 -1
  19. data/lib/rhc-rest/domain.rb +1 -1
  20. data/lib/rhc.rb +20 -0
  21. data/lib/rhc/cli.rb +38 -0
  22. data/lib/rhc/client.rb +15 -0
  23. data/lib/rhc/commands.rb +32 -0
  24. data/lib/rhc/commands/base.rb +67 -0
  25. data/lib/rhc/commands/server.rb +24 -0
  26. data/lib/rhc/config.rb +141 -0
  27. data/lib/rhc/core_ext.rb +15 -0
  28. data/lib/rhc/helpers.rb +142 -0
  29. data/lib/rhc/json.rb +52 -0
  30. data/lib/rhc/targz.rb +46 -0
  31. data/lib/rhc/vendor/okjson.rb +600 -0
  32. data/lib/rhc/vendor/zliby.rb +628 -0
  33. data/lib/rhc/wizard.rb +579 -0
  34. data/spec/rhc/assets/foo.txt +1 -0
  35. data/spec/rhc/assets/targz_corrupted.tar.gz +1 -0
  36. data/spec/rhc/assets/targz_sample.tar.gz +0 -0
  37. data/spec/rhc/cli_spec.rb +24 -0
  38. data/spec/rhc/command_spec.rb +88 -0
  39. data/spec/rhc/commands/server_spec.rb +39 -0
  40. data/spec/rhc/helpers_spec.rb +171 -0
  41. data/spec/rhc/json_spec.rb +30 -0
  42. data/spec/rhc/targz_spec.rb +42 -0
  43. data/spec/rhc/wizard_spec.rb +426 -0
  44. data/spec/spec_helper.rb +192 -0
  45. data/test/functional/application_test.rb +71 -0
  46. data/test/functional/domain_test.rb +123 -0
  47. data/test/functional/test_credentials.rb +5 -0
  48. data/test/sample-usage.rb +122 -0
  49. data/test/support/server.rb +14 -0
  50. data/test/support/testcase.rb +3 -0
  51. data/test/test_helper.rb +4 -0
  52. data/test/unit/command_test.rb +19 -0
  53. metadata +181 -29
  54. data/ext/mkrf_conf.rb +0 -58
  55. data/lib/rhc +0 -115
@@ -0,0 +1,14 @@
1
+ class Test::Unit::TestCase
2
+
3
+ def with_devenv
4
+ omit("Cannot run unless a devenv is specified")
5
+
6
+ @random = rand(1000)
7
+ end_point = "https://ec2-23-20-154-157.compute-1.amazonaws.com/broker/rest"
8
+ username = "rhc-rest-test-#{@random}"
9
+ password = "xyz123"
10
+ @client = Rhc::Rest::Client.new(end_point, username, password)
11
+ @domains = []
12
+ end
13
+
14
+ end
@@ -0,0 +1,3 @@
1
+ require 'test/unit'
2
+ require 'test/unit/omission'
3
+ require 'pp'
@@ -0,0 +1,4 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
+
3
+ # Load support files
4
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,19 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ class CommandTest < Test::Unit::TestCase
4
+
5
+ def define_test_command
6
+ Class.new(RHC::Commands::Base) do
7
+ def run
8
+ 1
9
+ end
10
+ end
11
+
12
+ end
13
+
14
+ test 'should register a command' do
15
+ assert_difference('commands.length', 1) do
16
+ define_test_command
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 377
4
+ hash: 335
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 92
9
- - 11
10
- version: 0.92.11
8
+ - 93
9
+ - 18
10
+ version: 0.93.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Red Hat
@@ -15,10 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-11 00:00:00 Z
18
+ date: 2012-06-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: parseconfig
21
+ name: rake
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
@@ -32,7 +32,7 @@ dependencies:
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: rest-client
35
+ name: sshkey
36
36
  prerelease: false
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
38
  none: false
@@ -46,7 +46,7 @@ dependencies:
46
46
  type: :runtime
47
47
  version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency
49
- name: rake
49
+ name: net-ssh
50
50
  prerelease: false
51
51
  requirement: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
@@ -59,29 +59,133 @@ dependencies:
59
59
  version: "0"
60
60
  type: :runtime
61
61
  version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: archive-tar-minitar
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: parseconfig
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :runtime
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: commander
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 27
99
+ segments:
100
+ - 4
101
+ - 0
102
+ version: "4.0"
103
+ type: :runtime
104
+ version_requirements: *id006
105
+ - !ruby/object:Gem::Dependency
106
+ name: rest-client
107
+ prerelease: false
108
+ requirement: &id007 !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 1
116
+ - 6
117
+ version: "1.6"
118
+ type: :runtime
119
+ version_requirements: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ name: webmock
122
+ prerelease: false
123
+ requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 1
131
+ - 6
132
+ version: "1.6"
133
+ type: :development
134
+ version_requirements: *id008
135
+ - !ruby/object:Gem::Dependency
136
+ name: rspec
137
+ prerelease: false
138
+ requirement: &id009 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ~>
142
+ - !ruby/object:Gem::Version
143
+ hash: 9
144
+ segments:
145
+ - 1
146
+ - 3
147
+ version: "1.3"
148
+ type: :development
149
+ version_requirements: *id009
150
+ - !ruby/object:Gem::Dependency
151
+ name: fakefs
152
+ prerelease: false
153
+ requirement: &id010 !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ hash: 3
159
+ segments:
160
+ - 0
161
+ - 4
162
+ version: "0.4"
163
+ type: :development
164
+ version_requirements: *id010
62
165
  description: The client tools for the OpenShift platform that allow for application management.
63
- email: openshift@redhat.com
166
+ email: dev@openshift.redhat.com
64
167
  executables:
65
- - rhc
66
- - rhc-domain
67
- - rhc-app
68
- - rhc-sshkey
168
+ - rhc-user-info
69
169
  - rhc-chk
70
170
  - rhc-create-app
71
- - rhc-create-domain
171
+ - rhc-domain-info
72
172
  - rhc-ctl-domain
173
+ - rhc-sshkey
174
+ - rhc-tail-files
175
+ - rhc-create-domain
73
176
  - rhc-ctl-app
177
+ - rhc-domain
74
178
  - rhc-snapshot
75
- - rhc-domain-info
76
- - rhc-user-info
77
- - rhc-tail-files
179
+ - rhc-app
78
180
  - rhc-port-forward
79
- extensions:
80
- - ext/mkrf_conf.rb
181
+ - rhc
182
+ extensions: []
183
+
81
184
  extra_rdoc_files: []
82
185
 
83
186
  files:
84
187
  - lib/rhc-common.rb
188
+ - lib/rhc.rb
85
189
  - lib/rhc-rest/domain.rb
86
190
  - lib/rhc-rest/application.rb
87
191
  - lib/rhc-rest/cartridge.rb
@@ -90,8 +194,44 @@ files:
90
194
  - lib/rhc-rest/exceptions/exceptions.rb
91
195
  - lib/rhc-rest/user.rb
92
196
  - lib/rhc-rest/version.rb
197
+ - lib/rhc/helpers.rb
198
+ - lib/rhc/cli.rb
199
+ - lib/rhc/config.rb
200
+ - lib/rhc/commands.rb
201
+ - lib/rhc/wizard.rb
202
+ - lib/rhc/core_ext.rb
203
+ - lib/rhc/client.rb
204
+ - lib/rhc/json.rb
205
+ - lib/rhc/vendor/okjson.rb
206
+ - lib/rhc/vendor/zliby.rb
207
+ - lib/rhc/commands/base.rb
208
+ - lib/rhc/commands/server.rb
209
+ - lib/rhc/targz.rb
93
210
  - lib/rhc-rest.rb
94
- - lib/rhc
211
+ - conf/express.conf
212
+ - LICENSE
213
+ - COPYRIGHT
214
+ - README.md
215
+ - Rakefile
216
+ - test/sample-usage.rb
217
+ - test/support/server.rb
218
+ - test/support/testcase.rb
219
+ - test/functional/test_credentials.rb
220
+ - test/functional/domain_test.rb
221
+ - test/functional/application_test.rb
222
+ - test/unit/command_test.rb
223
+ - test/test_helper.rb
224
+ - spec/spec_helper.rb
225
+ - spec/rhc/json_spec.rb
226
+ - spec/rhc/helpers_spec.rb
227
+ - spec/rhc/command_spec.rb
228
+ - spec/rhc/wizard_spec.rb
229
+ - spec/rhc/commands/server_spec.rb
230
+ - spec/rhc/cli_spec.rb
231
+ - spec/rhc/targz_spec.rb
232
+ - spec/rhc/assets/foo.txt
233
+ - spec/rhc/assets/targz_corrupted.tar.gz
234
+ - spec/rhc/assets/targz_sample.tar.gz
95
235
  - bin/rhc-user-info
96
236
  - bin/rhc-chk
97
237
  - bin/rhc-create-app
@@ -106,13 +246,7 @@ files:
106
246
  - bin/rhc-app
107
247
  - bin/rhc-port-forward
108
248
  - bin/rhc
109
- - conf/express.conf
110
- - LICENSE
111
- - COPYRIGHT
112
- - README.md
113
- - Rakefile
114
- - ext/mkrf_conf.rb
115
- homepage: https://openshift.redhat.com/app/express
249
+ homepage: https://github.com/openshift/os-client-tools
116
250
  licenses: []
117
251
 
118
252
  post_install_message:
@@ -145,5 +279,23 @@ rubygems_version: 1.8.11
145
279
  signing_key:
146
280
  specification_version: 3
147
281
  summary: OpenShift Client Tools
148
- test_files: []
149
-
282
+ test_files:
283
+ - test/sample-usage.rb
284
+ - test/support/server.rb
285
+ - test/support/testcase.rb
286
+ - test/functional/test_credentials.rb
287
+ - test/functional/domain_test.rb
288
+ - test/functional/application_test.rb
289
+ - test/unit/command_test.rb
290
+ - test/test_helper.rb
291
+ - spec/spec_helper.rb
292
+ - spec/rhc/json_spec.rb
293
+ - spec/rhc/helpers_spec.rb
294
+ - spec/rhc/command_spec.rb
295
+ - spec/rhc/wizard_spec.rb
296
+ - spec/rhc/commands/server_spec.rb
297
+ - spec/rhc/cli_spec.rb
298
+ - spec/rhc/targz_spec.rb
299
+ - spec/rhc/assets/foo.txt
300
+ - spec/rhc/assets/targz_corrupted.tar.gz
301
+ - spec/rhc/assets/targz_sample.tar.gz
data/ext/mkrf_conf.rb DELETED
@@ -1,58 +0,0 @@
1
- ## Add some testing for when we are building a rpm and when we're not
2
- msg = ''
3
-
4
- unless ENV['RHC_RPMBUILD']
5
- require 'rubygems'
6
- require 'rubygems/command.rb'
7
- require 'rubygems/dependency_installer.rb'
8
- require 'rubygems/uninstaller.rb'
9
- begin
10
- Gem::Command.build_args = ARGV
11
- rescue NoMethodError
12
- end
13
- inst = Gem::DependencyInstaller.new
14
- begin
15
- if RUBY_VERSION > "1.9"
16
- inst.install "test-unit"
17
- end
18
-
19
- # Attempt native json installation (unless JSON_PURE is specified)
20
- # - fall back to json_pure if it fails
21
- # - Known failure conditions
22
- # - Ubuntu: using ruby and not ruby-dev
23
- begin
24
- throw if ENV['JSON_PURE']
25
- inst.install('json')
26
- rescue
27
- inst.install('json_pure')
28
- end
29
-
30
- rescue
31
- exit(1)
32
- end
33
-
34
- # Remove rhc-rest if it's installed
35
- begin
36
- Gem::Uninstaller.new('rhc-rest').uninstall
37
-
38
- # This only gets printed if verbose is specified
39
- # TODO: Need to figure out how to get it always shown
40
- msg = <<-MSG
41
- ===================================================
42
- rhc-rest is no longer needed as an external gem
43
- - If it is installed, it will be removed
44
- - Its libraries are now included in rhc
45
- - Any applications requiring rhc-rest will
46
- still function as expected
47
- ===================================================
48
- MSG
49
- rescue Gem::LoadError,Gem::InstallError
50
- # This means that rhc-rest was not installed, not a problem
51
- end
52
- end
53
-
54
- f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
55
- f.write("task :default do\n")
56
- f.write("\tputs '%s'\n" % msg) if msg
57
- f.write("end\n")
58
- f.close
data/lib/rhc DELETED
@@ -1,115 +0,0 @@
1
- #
2
- # This is the bash auto completion script for the rhc command
3
- #
4
- _rhc()
5
- {
6
- local cur opts
7
- COMPREPLY=()
8
- cur="${COMP_WORDS[COMP_CWORD]}"
9
-
10
- if [ $COMP_CWORD -eq 1 ]; then
11
- opts="domain app sshkey port-forward help"
12
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
13
- elif [ $COMP_CWORD -eq 2 ]; then
14
- case "${COMP_WORDS[1]}" in
15
- domain)
16
- opts="create show alter status destroy"
17
- ;;
18
- app)
19
- opts="create show start stop force-stop restart reload status destroy tidy add-alias remove-alias threaddump snapshot tail cartridge"
20
- ;;
21
- sshkey)
22
- opts="add update remove list"
23
- ;;
24
- port-forward)
25
- opts="--debug --help --rhlogin --password --namespace --config --timeout --app"
26
- ;;
27
- *)
28
- opts=""
29
- ;;
30
- esac
31
-
32
- elif [ $COMP_CWORD -eq 3 ]; then
33
- case "${COMP_WORDS[1]}" in
34
- domain)
35
- case "${COMP_WORDS[2]}" in
36
- create | alter | destroy)
37
- opts="--debug --help --rhlogin --password --namespace --config --timeout"
38
- ;;
39
- show | status)
40
- opts="--debug --help --rhlogin --password --config --timeout"
41
- ;;
42
- *)
43
- ;;
44
- esac
45
- ;;
46
- app)
47
- case "${COMP_WORDS[2]}" in
48
- create)
49
- opts="--debug --help --rhlogin --password --no-dns --nogit --app --repo --type --enable-jenkins --config --timeout"
50
- ;;
51
- show | start | stop | force-stop | restart | reload | status | destroy | tidy | add-alias | remove-alias | threaddump | destroy )
52
- opts="--debug --help --rhlogin --password --app --alias --bypass --config --timeout"
53
- ;;
54
- tail)
55
- opts="--debug --help --rhlogin --password --app --opts --filepath --config --timeout"
56
- ;;
57
- snapshot)
58
- opts="save restore"
59
- ;;
60
- cartridge)
61
- opts="add remove stop start restart status reload list"
62
- ;;
63
- *)
64
- ;;
65
- esac
66
- ;;
67
- sshkey)
68
- case "${COMP_WORDS[2]}" in
69
- add | update)
70
- opts="--debug --help --rhlogin --password --identifier --ssh --config --timeout"
71
- ;;
72
- remove)
73
- opts="--debug --help --rhlogin --password --identifier --config --timeout"
74
- ;;
75
- list)
76
- opts="--debug --help --rhlogin --password --config --timeout"
77
- ;;
78
- *)
79
- ;;
80
- esac
81
- ;;
82
- esac
83
-
84
- elif [ $COMP_CWORD -eq 4 ]; then
85
- case "${COMP_WORDS[1]}" in
86
- app)
87
- case "${COMP_WORDS[2]}" in
88
- snapshot)
89
- case "${COMP_WORDS[3]}" in
90
- save | restore)
91
- opts="--debug --help --rhlogin --password --app --filepath --config --timeout"
92
- ;;
93
- *)
94
- ;;
95
- esac
96
- ;;
97
- cartridge)
98
- case "${COMP_WORDS[3]}" in
99
- add | remove | stop | start | restart | status | reload | list)
100
- opts="--debug --help --rhlogin --password --app --cartridge --config --timeout"
101
- ;;
102
- *)
103
- ;;
104
- esac
105
- ;;
106
- esac
107
- ;;
108
- esac
109
-
110
- fi
111
-
112
- if [ ${#opts[@]} -gt 0 ]; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ); fi
113
- return 0
114
- }
115
- complete -o default -F _rhc rhc