rhoconnect 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +26 -45
- data/Rakefile +2 -3
- data/bench/bench_runner.rb +37 -37
- data/bench/benchapp/Gemfile.lock +4 -5
- data/bench/benchapp/config.ru +1 -5
- data/bench/benchapp/spec/spec_helper.rb +0 -13
- data/bench/blobapp/Gemfile.lock +8 -9
- data/bench/blobapp/config.ru +1 -2
- data/bench/blobapp/spec/spec_helper.rb +0 -13
- data/bench/lib/bench/aws_utils.rb +0 -1
- data/bench/spec/bench_spec_helper.rb +1 -1
- data/doc/java-plugin.txt +176 -49
- data/doc/net-plugin.txt +150 -70
- data/doc/plugin-intro.txt +2 -2
- data/doc/supported-platforms.txt +12 -11
- data/generators/templates/application/config.ru +1 -2
- data/generators/templates/application/spec/spec_helper.rb +0 -15
- data/install.sh +3 -3
- data/installer/unix-like/create_texts.rb +2 -2
- data/installer/unix-like/rho_connect_install_constants.rb +3 -3
- data/installer/unix-like/rho_connect_install_utilities.rb +0 -1
- data/installer/utils/constants.rb +5 -5
- data/installer/utils/create_sha1.rb +26 -0
- data/installer/utils/delete_from_s3.rb +32 -0
- data/installer/utils/download_from_s3.rb +55 -0
- data/installer/utils/nix_install_test.rb +29 -19
- data/installer/utils/package_upload/repos.rake +52 -40
- data/installer/utils/package_upload/s3_upload.rb +7 -28
- data/installer/utils/verify_checksum.rb +33 -0
- data/installer/windows/rhosync.nsi +5 -5
- data/lib/rhoconnect.rb +1 -1
- data/lib/rhoconnect/app.rb +0 -3
- data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +6 -0
- data/lib/rhoconnect/server.rb +27 -24
- data/lib/rhoconnect/stats/middleware.rb +13 -8
- data/lib/rhoconnect/store.rb +12 -10
- data/lib/rhoconnect/version.rb +1 -1
- data/rhoconnect.gemspec +2 -2
- data/spec/api/admin/api_token_spec.rb +0 -1
- data/spec/api/admin/stats_spec.rb +3 -0
- data/spec/api/api_helper.rb +2 -2
- data/spec/api/user/list_users_spec.rb +2 -2
- data/spec/api_token_spec.rb +0 -1
- data/spec/app_spec.rb +0 -1
- data/spec/bulk_data/bulk_data_spec.rb +0 -1
- data/spec/client_spec.rb +0 -1
- data/spec/client_sync_spec.rb +0 -2
- data/spec/document_spec.rb +0 -1
- data/spec/dynamic_adapter_spec.rb +0 -2
- data/spec/jobs/bulk_data_job_spec.rb +0 -1
- data/spec/jobs/ping_job_spec.rb +0 -1
- data/spec/jobs/source_job_spec.rb +0 -1
- data/spec/license_spec.rb +0 -1
- data/spec/perf/perf_spec_helper.rb +0 -1
- data/spec/ping/android_spec.rb +0 -1
- data/spec/ping/apple_spec.rb +0 -1
- data/spec/ping/blackberry_spec.rb +0 -1
- data/spec/read_state_spec.rb +0 -1
- data/spec/rhoconnect_spec.rb +0 -1
- data/spec/server/server_spec.rb +1 -12
- data/spec/source_adapter_spec.rb +0 -1
- data/spec/source_spec.rb +0 -1
- data/spec/source_sync_spec.rb +0 -1
- data/spec/spec_helper.rb +8 -19
- data/spec/stats/middleware_spec.rb +9 -0
- data/spec/stats/record_spec.rb +1 -0
- data/spec/store_spec.rb +6 -1
- data/spec/sync_states_spec.rb +0 -1
- data/spec/test_methods_spec.rb +0 -1
- data/spec/user_spec.rb +0 -1
- data/tasks/redis.rake +4 -2
- metadata +421 -436
- data/bin/thorhoconnect +0 -79
- data/installer/utils/package_upload/auto-repo.rb +0 -136
data/bin/thorhoconnect
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'templater'
|
5
|
-
require ''
|
6
|
-
require File.join(File.dirname(__FILE__), '..','generators','rhoconnect')
|
7
|
-
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
8
|
-
require File.join(File.dirname(__FILE__), '..','lib','rhoconnect')
|
9
|
-
|
10
|
-
# CONSTANTS
|
11
|
-
|
12
|
-
OPTIONS = {'start' => 'Start the rhoconnect service.',
|
13
|
-
'stop' => 'Stop the rhoconnect service.',
|
14
|
-
'restart' => 'Stop and then start the rhoconnect service.'}
|
15
|
-
|
16
|
-
# CLASSES
|
17
|
-
|
18
|
-
# Stub this method to force 1.8 compatibility (come on templater!)
|
19
|
-
class Encoding
|
20
|
-
def find
|
21
|
-
"utf-8"
|
22
|
-
end
|
23
|
-
|
24
|
-
def dummy?
|
25
|
-
false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class String
|
30
|
-
def force_encoding(enc)
|
31
|
-
return self
|
32
|
-
end
|
33
|
-
def encoding
|
34
|
-
if RUBY_VERSION =~ /1\.8/ and Encoding.responds_to?('new')
|
35
|
-
Encoding.new
|
36
|
-
else
|
37
|
-
Encoding.default_external
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# METHODS
|
43
|
-
|
44
|
-
# check_options
|
45
|
-
# Verifies that the options passed in are part of the valid options set
|
46
|
-
# (Only for non-generation operations)
|
47
|
-
def check_options
|
48
|
-
option_names = OPTIONS.keys
|
49
|
-
ARGV.each do |opt|
|
50
|
-
if !option_names.include? opt
|
51
|
-
puts "Unknown option: #{opt}"
|
52
|
-
print_usage
|
53
|
-
exit
|
54
|
-
end #if
|
55
|
-
end #do
|
56
|
-
end #check_options
|
57
|
-
|
58
|
-
# print_usage
|
59
|
-
# Displays usage information for non-generation operations
|
60
|
-
def print_usage
|
61
|
-
usage = "Usage: #{$0} [options]\n\n" +
|
62
|
-
"General Options:\n"
|
63
|
-
# Compile valid options from OPTIONS hash
|
64
|
-
OPTIONS.each do |key, value|
|
65
|
-
usage << sprintf(" %-32s %s", key, value)
|
66
|
-
end #do
|
67
|
-
puts usage
|
68
|
-
end #print_usage
|
69
|
-
|
70
|
-
# SCRIPT
|
71
|
-
|
72
|
-
# Determine whether rhoconnect is being used for generation or not
|
73
|
-
if !ARGV.include? 'app' and
|
74
|
-
!ARGV.include? 'source'
|
75
|
-
check_options
|
76
|
-
|
77
|
-
else
|
78
|
-
Rhoconnect.run_cli(Dir.pwd, 'rhoconnect', Rhoconnect::VERSION, ARGV)
|
79
|
-
end #if
|
@@ -1,136 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'aws/s3'
|
5
|
-
require 'find'
|
6
|
-
|
7
|
-
# CONSTANTS
|
8
|
-
|
9
|
-
ACCESS_KEY_FILE = '/Users/rhomobile/.s3/keys'
|
10
|
-
SOURCE = ARGV[0]
|
11
|
-
BUCKET = ARGV[1]
|
12
|
-
PKG_TYPE = ARGV[2]
|
13
|
-
PKG_DIR = '/packages'
|
14
|
-
|
15
|
-
# METHODS
|
16
|
-
|
17
|
-
def cmd(cmd)
|
18
|
-
puts cmd
|
19
|
-
system(cmd)
|
20
|
-
end #cmd
|
21
|
-
|
22
|
-
def print_usage
|
23
|
-
puts "Usage: #{$0} source_file dest_bucket package_type"
|
24
|
-
end #print_usage
|
25
|
-
|
26
|
-
def check_params
|
27
|
-
error = false
|
28
|
-
if ARGV.size != 3
|
29
|
-
puts "Wrong number of arguments (#{ARGV.size} for 2)"
|
30
|
-
error = true
|
31
|
-
end #if
|
32
|
-
|
33
|
-
if !FileTest.exists?(SOURCE)
|
34
|
-
puts "#{SOURCE} does not exist!"
|
35
|
-
error = true
|
36
|
-
end #if
|
37
|
-
|
38
|
-
begin
|
39
|
-
found = AWS::S3::Bucket.find(BUCKET)
|
40
|
-
rescue
|
41
|
-
puts "#{BUCKET} is not a valid bucket."
|
42
|
-
error = true
|
43
|
-
end
|
44
|
-
|
45
|
-
if error
|
46
|
-
print_usage
|
47
|
-
end #if
|
48
|
-
|
49
|
-
end #check_params
|
50
|
-
|
51
|
-
def prepare_destination
|
52
|
-
if PKG_TYPE == 'deb'
|
53
|
-
# Remove the /deb directory if it exists
|
54
|
-
if File.directory?("#{PKG_DIR}/deb")
|
55
|
-
cmd "sudo rm -rf #{PKG_DIR}/deb"
|
56
|
-
end #if
|
57
|
-
|
58
|
-
# Create deb directory if it does not already exist
|
59
|
-
cmd "sudo mkdir -p #{PKG_DIR}/deb" unless File.directory?("#{PKG_DIR}/deb")
|
60
|
-
|
61
|
-
# Create configuration file "ditributions" in deb directory
|
62
|
-
filename = "#{PKG_DIR}/deb/conf/"
|
63
|
-
cmd "sudo mkdir -p #{filename}"
|
64
|
-
distributions = "Origin: Rhomobile, Inc.\n" +
|
65
|
-
"Label: Rhomobile, Inc.\n" +
|
66
|
-
"Codename: rhoconnect\n" +
|
67
|
-
"Architectures: i386 amd64\n" +
|
68
|
-
"Components: main\n" +
|
69
|
-
"Description: Rhoconnect APT Repository"
|
70
|
-
|
71
|
-
cmd "touch #{filename}/distributions"
|
72
|
-
|
73
|
-
# Write distributions string to corresponding file
|
74
|
-
dist_file = File.new("#{filename}/distributions", "w")
|
75
|
-
dist_file.write(distributions)
|
76
|
-
dist_file.close
|
77
|
-
else
|
78
|
-
# Create rpm directory if it does not already exist
|
79
|
-
cmd "sudo mkdir -p #{PKG_DIR}/rpm" unless File.directory?("#{PKG_DIR}/rpm")
|
80
|
-
end #if
|
81
|
-
|
82
|
-
end #prepare_destination
|
83
|
-
|
84
|
-
def get_keys
|
85
|
-
lines = IO.readlines ACCESS_KEY_FILE
|
86
|
-
@access_key = lines.first.strip
|
87
|
-
@secret_access_key = lines.last.strip
|
88
|
-
end #get_keys
|
89
|
-
|
90
|
-
def establish_s3_connection
|
91
|
-
get_keys
|
92
|
-
@s3_connection = AWS::S3::Base.establish_connection!( :access_key_id => @access_key,
|
93
|
-
:secret_access_key => @secret_access_key )
|
94
|
-
end #establish_s3_connection
|
95
|
-
|
96
|
-
def upload(file)
|
97
|
-
puts "Uploading #{file} to bucket #{BUCKET}..." unless @raked
|
98
|
-
# Upload the given file
|
99
|
-
AWS::S3::S3Object.store( file,
|
100
|
-
open( file ),
|
101
|
-
BUCKET,
|
102
|
-
:access => :public_read )
|
103
|
-
|
104
|
-
# Display the URL of the file just uploaded
|
105
|
-
puts AWS::S3::S3Object.url_for((file), BUCKET)[/[^?]+/]
|
106
|
-
puts
|
107
|
-
end #upload
|
108
|
-
|
109
|
-
def upload_files
|
110
|
-
# Get list of files do be added
|
111
|
-
number_of_files = 0
|
112
|
-
paths = []
|
113
|
-
Find.find(START_DIR) do |path|
|
114
|
-
if FileTest.directory?(path)
|
115
|
-
next
|
116
|
-
else
|
117
|
-
paths.push(path)
|
118
|
-
number_of_files += 1
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
puts "Uploading #{number_of_files} files."
|
123
|
-
paths.each do |path|
|
124
|
-
upload path
|
125
|
-
end #do
|
126
|
-
puts "#{number_of_files} files uploaded."
|
127
|
-
|
128
|
-
end #upload_files
|
129
|
-
|
130
|
-
# SCRIPT
|
131
|
-
|
132
|
-
check_params
|
133
|
-
|
134
|
-
prepare_destination
|
135
|
-
|
136
|
-
upload_files
|