rhc 0.69.6 → 0.71.2
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.
- data/bin/rhc-create-app +9 -10
- data/bin/rhc-create-domain +1 -1
- data/bin/rhc-ctl-app +1 -2
- data/bin/rhc-snapshot +4 -5
- data/bin/rhc-tail-files +6 -7
- data/bin/rhc-user-info +3 -4
- data/conf/express.conf +0 -3
- data/lib/rhc-common.rb +14 -4
- metadata +4 -4
data/bin/rhc-create-app
CHANGED
|
@@ -25,11 +25,11 @@ require 'rhc-common'
|
|
|
25
25
|
|
|
26
26
|
def p_usage
|
|
27
27
|
rhlogin = get_var('default_rhlogin') ? "Default: #{get_var('default_rhlogin')}" : "(required)"
|
|
28
|
-
type_keys = RHC::
|
|
28
|
+
type_keys = RHC::get_supported_cartridge_types(', ')
|
|
29
29
|
puts <<USAGE
|
|
30
30
|
|
|
31
31
|
Usage: #{$0}
|
|
32
|
-
Create
|
|
32
|
+
Create an Openshift Express app.
|
|
33
33
|
|
|
34
34
|
-a|--app application Application name (alphanumeric - max #{RHC::Maxdlen} chars) (required)
|
|
35
35
|
-t|--type type Type of app to create (#{type_keys}) (required)
|
|
@@ -65,7 +65,6 @@ rescue Exception => e
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
# Pull in configs from files
|
|
68
|
-
libra_domain = get_var('libra_domain')
|
|
69
68
|
libra_server = get_var('libra_server')
|
|
70
69
|
debug = get_var('debug') == 'false' ? nil : get_var('debug')
|
|
71
70
|
|
|
@@ -216,14 +215,14 @@ puts "Checking ~/.ssh/config"
|
|
|
216
215
|
|
|
217
216
|
user_info = RHC::get_user_info(libra_server, opt['rhlogin'], password, @http, debug, false)
|
|
218
217
|
|
|
219
|
-
my_url = "#{opt['app']}-#{user_info['user_info']['namespace']}.#{
|
|
218
|
+
my_url = "#{opt['app']}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']}"
|
|
220
219
|
|
|
221
220
|
found = false
|
|
222
221
|
|
|
223
222
|
begin
|
|
224
223
|
File.open(ssh_config, "r") do |sline|
|
|
225
224
|
while(line = sline.gets)
|
|
226
|
-
if line.to_s.start_with? "Host *.#{
|
|
225
|
+
if line.to_s.start_with? "Host *.#{user_info['user_info']['rhc_domain']}"
|
|
227
226
|
found = true
|
|
228
227
|
break
|
|
229
228
|
end
|
|
@@ -240,15 +239,15 @@ rescue Errno::ENOENT
|
|
|
240
239
|
puts "Could not find #{ssh_config}. This is ok, continuing"
|
|
241
240
|
end
|
|
242
241
|
if found
|
|
243
|
-
puts "Found #{
|
|
242
|
+
puts "Found #{user_info['user_info']['rhc_domain']} in ~/.ssh/config... No need to adjust"
|
|
244
243
|
else
|
|
245
|
-
puts " Adding #{
|
|
244
|
+
puts " Adding #{user_info['user_info']['rhc_domain']} to ~/.ssh/config"
|
|
246
245
|
begin
|
|
247
246
|
f = File.open(ssh_config, "a")
|
|
248
247
|
f.puts <<SSH
|
|
249
248
|
|
|
250
|
-
# Added by rhc-create-app
|
|
251
|
-
Host *.#{
|
|
249
|
+
# Added by rhc-create-app on #{`date`}
|
|
250
|
+
Host *.#{user_info['user_info']['rhc_domain']}
|
|
252
251
|
IdentityFile ~/.ssh/libra_id_rsa
|
|
253
252
|
VerifyHostKeyDNS yes
|
|
254
253
|
StrictHostKeyChecking no
|
|
@@ -306,7 +305,7 @@ attempt = 0
|
|
|
306
305
|
# Pull new repo locally
|
|
307
306
|
#
|
|
308
307
|
|
|
309
|
-
git_url = "ssh://#{uuid}@#{opt['app']}-#{user_info['user_info']['namespace']}.#{
|
|
308
|
+
git_url = "ssh://#{uuid}@#{opt['app']}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']}/~/git/#{opt['app']}.git/"
|
|
310
309
|
|
|
311
310
|
unless opt['nogit']
|
|
312
311
|
puts "Pulling new repo down"
|
data/bin/rhc-create-domain
CHANGED
|
@@ -35,7 +35,7 @@ Bind a registered rhcloud user to a domain in rhcloud.
|
|
|
35
35
|
NOTE: to change ssh key, please alter your ~/.ssh/libra_id_rsa and
|
|
36
36
|
~/.ssh/libra_id_rsa.pub key, then re-run with --alter
|
|
37
37
|
|
|
38
|
-
-n|--namespace namespace
|
|
38
|
+
-n|--namespace namespace Openshift Express namespace (alphanumeric - max #{RHC::Maxdlen} chars) (required)
|
|
39
39
|
-l|--rhlogin rhlogin Red Hat login (required)
|
|
40
40
|
-p|--password password RHLogin password (optional, will prompt)
|
|
41
41
|
-a|--alter Alter namespace (will change urls) and/or ssh key
|
data/bin/rhc-ctl-app
CHANGED
|
@@ -62,7 +62,6 @@ rescue Exception => e
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
# Pull in configs from files
|
|
65
|
-
libra_domain = get_var('libra_domain')
|
|
66
65
|
libra_server = get_var('libra_server')
|
|
67
66
|
debug = get_var('debug') == 'false' ? nil : get_var('debug')
|
|
68
67
|
ssh_config = "#{ENV['HOME']}/.ssh/config"
|
|
@@ -123,7 +122,7 @@ if !opt["bypass"] and opt["command"] == "deconfigure"
|
|
|
123
122
|
!!!! WARNING !!!! WARNING !!!! WARNING !!!!
|
|
124
123
|
You are about to destroy the #{opt['app']} application.
|
|
125
124
|
|
|
126
|
-
This is NOT
|
|
125
|
+
This is NOT reversible, all remote data for this application will be removed.
|
|
127
126
|
WARNING
|
|
128
127
|
|
|
129
128
|
print "Do you want to destroy this application (y/n): "
|
data/bin/rhc-snapshot
CHANGED
|
@@ -30,7 +30,7 @@ def p_usage
|
|
|
30
30
|
rhlogin = get_var('default_rhlogin') ? "Default: #{get_var('default_rhlogin')}" : "(required)"
|
|
31
31
|
puts <<USAGE
|
|
32
32
|
|
|
33
|
-
Usage:
|
|
33
|
+
Usage: #{$0}
|
|
34
34
|
Pull down application snapshot for a user
|
|
35
35
|
|
|
36
36
|
-l|--rhlogin rhlogin RHCloud rhlogin (#{rhlogin})
|
|
@@ -65,7 +65,6 @@ end
|
|
|
65
65
|
# Pull in configs from files
|
|
66
66
|
libra_server = get_var('libra_server')
|
|
67
67
|
debug = get_var('debug') == 'false' ? nil : get_var('debug')
|
|
68
|
-
libra_domain = get_var('libra_domain')
|
|
69
68
|
|
|
70
69
|
libra_kfile = "#{ENV['HOME']}/.ssh/libra_id_rsa"
|
|
71
70
|
libra_kpfile = "#{ENV['HOME']}/.ssh/libra_id_rsa.pub"
|
|
@@ -106,13 +105,13 @@ end
|
|
|
106
105
|
|
|
107
106
|
puts "Pulling down a snapshot to #{opt['save']}"
|
|
108
107
|
puts
|
|
109
|
-
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
110
|
-
git_pull = `ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
108
|
+
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'snapshot #{framework} #{app}' > #{opt['save']}" if debug
|
|
109
|
+
git_pull = `ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'snapshot #{framework} #{app}' > #{opt['save']}`
|
|
111
110
|
if $?.exitstatus != 0
|
|
112
111
|
puts
|
|
113
112
|
puts "Error in trying to save snapshot. You can try to save manually by running:"
|
|
114
113
|
puts
|
|
115
|
-
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
114
|
+
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'snapshot #{framework} #{app}' > #{opt['save']}"
|
|
116
115
|
puts
|
|
117
116
|
exit 254
|
|
118
117
|
end
|
data/bin/rhc-tail-files
CHANGED
|
@@ -30,11 +30,11 @@ def p_usage
|
|
|
30
30
|
rhlogin = get_var('default_rhlogin') ? "Default: #{get_var('default_rhlogin')}" : "(required)"
|
|
31
31
|
puts <<USAGE
|
|
32
32
|
|
|
33
|
-
Usage:
|
|
34
|
-
|
|
33
|
+
Usage: #{$0}
|
|
34
|
+
Tail the logs of an application
|
|
35
35
|
|
|
36
36
|
-l|--rhlogin rhlogin RHCloud rhlogin (#{rhlogin})
|
|
37
|
-
-a|--app Target application
|
|
37
|
+
-a|--app Target application (required)
|
|
38
38
|
-f|--files File glob relative to app (default ./logs/*) (optional)
|
|
39
39
|
-p|--password password RHLogin password (optional, will prompt)
|
|
40
40
|
-d|--debug Print Debug info
|
|
@@ -65,7 +65,6 @@ end
|
|
|
65
65
|
# Pull in configs from files
|
|
66
66
|
libra_server = get_var('libra_server')
|
|
67
67
|
debug = get_var('debug') == 'false' ? nil : get_var('debug')
|
|
68
|
-
libra_domain = get_var('libra_domain')
|
|
69
68
|
|
|
70
69
|
libra_kfile = "#{ENV['HOME']}/.ssh/libra_id_rsa"
|
|
71
70
|
libra_kpfile = "#{ENV['HOME']}/.ssh/libra_id_rsa.pub"
|
|
@@ -109,13 +108,13 @@ file_glob = "#{framework}/#{opt['app']}/#{opt['files']}"
|
|
|
109
108
|
puts "Attempting to tail files: #{file_glob}"
|
|
110
109
|
puts "Use ctl + c to stop"
|
|
111
110
|
puts
|
|
112
|
-
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
113
|
-
system("ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
111
|
+
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'tail #{file_glob}'" if debug
|
|
112
|
+
system("ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'tail #{file_glob}'")
|
|
114
113
|
if $?.exitstatus != 0 and $?.exitstatus != 255
|
|
115
114
|
puts
|
|
116
115
|
puts "Error in trying to tail files. You can tail manually by running:"
|
|
117
116
|
puts
|
|
118
|
-
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{
|
|
117
|
+
puts "ssh #{user_info['user_info']['uuid']}@#{app}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']} 'tail #{file_glob}'`"
|
|
119
118
|
puts
|
|
120
119
|
exit 254
|
|
121
120
|
end
|
data/bin/rhc-user-info
CHANGED
|
@@ -38,7 +38,7 @@ def p_usage
|
|
|
38
38
|
rhlogin = get_var('default_rhlogin') ? "Default: #{get_var('default_rhlogin')}" : "(required)"
|
|
39
39
|
puts <<USAGE
|
|
40
40
|
|
|
41
|
-
Usage:
|
|
41
|
+
Usage: #{$0}
|
|
42
42
|
Display information about a user
|
|
43
43
|
|
|
44
44
|
-l|--rhlogin rhlogin RHCloud rhlogin (#{rhlogin})
|
|
@@ -85,7 +85,6 @@ end
|
|
|
85
85
|
# Pull in configs from files
|
|
86
86
|
libra_server = get_var('libra_server')
|
|
87
87
|
debug = get_var('debug') == 'false' ? nil : get_var('debug')
|
|
88
|
-
libra_domain = get_var('libra_domain')
|
|
89
88
|
|
|
90
89
|
libra_kfile = "#{ENV['HOME']}/.ssh/libra_id_rsa"
|
|
91
90
|
libra_kpfile = "#{ENV['HOME']}/.ssh/libra_id_rsa.pub"
|
|
@@ -141,8 +140,8 @@ if opt['apps']
|
|
|
141
140
|
puts key
|
|
142
141
|
puts " Framework: #{val['framework']}"
|
|
143
142
|
puts " Creation: #{val['creation_time']}"
|
|
144
|
-
puts " Git URL: ssh://#{user_info['user_info']['uuid']}@#{key}-#{user_info['user_info']['namespace']}.#{
|
|
145
|
-
puts " Public URL: http://#{key}-#{user_info['user_info']['namespace']}.#{
|
|
143
|
+
puts " Git URL: ssh://#{user_info['user_info']['uuid']}@#{key}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']}/~/git/#{key}.git/"
|
|
144
|
+
puts " Public URL: http://#{key}-#{user_info['user_info']['namespace']}.#{user_info['user_info']['rhc_domain']}/"
|
|
146
145
|
puts ""
|
|
147
146
|
end
|
|
148
147
|
|
data/conf/express.conf
CHANGED
data/lib/rhc-common.rb
CHANGED
|
@@ -44,17 +44,27 @@ module RHC
|
|
|
44
44
|
'wsgi-3.2.1' => :wsgi,
|
|
45
45
|
'jbossas-7.0.0' => :jbossas
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
SUPPORTED_TYPES = {
|
|
49
|
+
'php-5.3.2' => :php,
|
|
50
|
+
'rack-1.1.0' => :rack,
|
|
51
|
+
'wsgi-3.2.1' => :wsgi
|
|
52
|
+
}
|
|
47
53
|
|
|
48
54
|
def self.delay(time, adj=Defaultdelay)
|
|
49
55
|
(time*=adj).to_int
|
|
50
56
|
end
|
|
57
|
+
|
|
58
|
+
def self.get_supported_cartridge_types(sep=', ')
|
|
59
|
+
return get_cartridge_types(SUPPORTED_TYPES)
|
|
60
|
+
end
|
|
51
61
|
|
|
52
|
-
def self.get_cartridge_types(sep=', ')
|
|
62
|
+
def self.get_cartridge_types(types=TYPES, sep=', ')
|
|
53
63
|
i = 1
|
|
54
64
|
type_keys = ''
|
|
55
|
-
|
|
65
|
+
types.each_key do |key|
|
|
56
66
|
type_keys += key
|
|
57
|
-
if i <
|
|
67
|
+
if i < types.size
|
|
58
68
|
type_keys += sep
|
|
59
69
|
end
|
|
60
70
|
i += 1
|
|
@@ -107,7 +117,7 @@ module RHC
|
|
|
107
117
|
def self.get_cartridge(type)
|
|
108
118
|
if type
|
|
109
119
|
if !(RHC::TYPES.has_key?(type))
|
|
110
|
-
puts 'type must be ' <<
|
|
120
|
+
puts 'type must be ' << get_supported_cartridge_types(' or ')
|
|
111
121
|
else
|
|
112
122
|
return RHC::TYPES[type]
|
|
113
123
|
end
|
metadata
CHANGED
|
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 0.
|
|
8
|
+
- 71
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.71.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Red Hat
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-05-
|
|
18
|
+
date: 2011-05-31 00:00:00 -05:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|