rhoconnect 3.1.2 → 3.2.0.beta1
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/CHANGELOG.md +14 -2
- data/CREDITS +151 -10
- data/Gemfile +16 -5
- data/Gemfile.lock +58 -23
- data/Rakefile +70 -50
- data/bench/bench_runner.rb +2 -2
- data/bench/benchapp/Gemfile +6 -0
- data/bench/benchapp/Gemfile.lock +5 -0
- data/bench/benchapp/config.ru +2 -0
- data/bench/lib/bench/cli.rb +2 -0
- data/bench/lib/bench/distr_runner.rb +3 -2
- data/bench/lib/bench/runner.rb +1 -1
- data/bench/lib/bench.rb +10 -1
- data/bench/run_bench.sh +1 -1
- data/bench/scripts/test_query_script.rb +2 -1
- data/bench/spec/bench_spec_helper.rb +1 -0
- data/bin/rhoconnect +9 -27
- data/bin/rhoconnect-benchmark +10 -1
- data/commands/commands/dtach_commands/dtach_about.rb +6 -0
- data/commands/commands/dtach_commands/dtach_install.rb +30 -0
- data/commands/commands/redis_commands/redis_about.rb +6 -0
- data/commands/commands/redis_commands/redis_attach.rb +6 -0
- data/commands/commands/redis_commands/redis_download.rb +33 -0
- data/commands/commands/redis_commands/redis_install.rb +26 -0
- data/commands/commands/redis_commands/redis_make.rb +9 -0
- data/commands/commands/redis_commands/redis_restart.rb +7 -0
- data/commands/commands/redis_commands/redis_runner.rb +67 -0
- data/commands/commands/redis_commands/redis_start.rb +6 -0
- data/commands/commands/redis_commands/redis_startbg.rb +6 -0
- data/commands/commands/redis_commands/redis_stop.rb +6 -0
- data/commands/commands/rhoconnect/attach.rb +7 -0
- data/commands/commands/rhoconnect/clean_start.rb +9 -0
- data/commands/commands/rhoconnect/config.rb +15 -0
- data/commands/commands/rhoconnect/console.rb +15 -0
- data/commands/commands/rhoconnect/console_helper.rb +3 -0
- data/commands/commands/rhoconnect/create_user.rb +18 -0
- data/commands/commands/rhoconnect/delete_device.rb +9 -0
- data/commands/commands/rhoconnect/delete_user.rb +8 -0
- data/commands/commands/rhoconnect/flushdb.rb +14 -0
- data/commands/commands/rhoconnect/get_token.rb +25 -0
- data/commands/commands/rhoconnect/reset.rb +16 -0
- data/commands/commands/rhoconnect/reset_refresh.rb +11 -0
- data/commands/commands/rhoconnect/restart.rb +7 -0
- data/commands/commands/rhoconnect/secret.rb +11 -0
- data/commands/commands/rhoconnect/set_admin_password.rb +26 -0
- data/commands/commands/rhoconnect/spec.rb +15 -0
- data/commands/commands/rhoconnect/start.rb +18 -0
- data/commands/commands/rhoconnect/startbg.rb +34 -0
- data/commands/commands/rhoconnect/startdebug.rb +35 -0
- data/commands/commands/rhoconnect/stop.rb +11 -0
- data/commands/commands/rhoconnect/war.rb +32 -0
- data/commands/commands/rhoconnect/web.rb +7 -0
- data/commands/execute.rb +35 -0
- data/commands/generators/app.rb +6 -0
- data/commands/generators/source.rb +6 -0
- data/commands/utilities/dtach_installed.rb +10 -0
- data/doc/benchmarks-running.txt +5 -0
- data/doc/command-line.txt +216 -27
- data/doc/heroku-addon.txt +1 -1
- data/doc/preparing-production.txt +20 -1
- data/doc/public/cli.txt +191 -0
- data/doc/push-backend-setup.txt +148 -0
- data/doc/push-client-setup.txt +61 -0
- data/doc/push-server-setup.txt +91 -0
- data/doc/push.txt +8 -137
- data/doc/rest-api.txt +96 -0
- data/doc/settings.txt +1 -1
- data/doc/supported-platforms.txt +2 -1
- data/doc/tutorial.txt +6 -4
- data/examples/simple/Gemfile +39 -0
- data/examples/simple/Rakefile +7 -12
- data/examples/simple/config.ru +16 -31
- data/examples/simple/settings/settings.yml +5 -4
- data/examples/simple/sources/product.rb +51 -0
- data/generators/templates/application/Gemfile +7 -0
- data/generators/templates/application/Rakefile +5 -18
- data/generators/templates/application/config.ru +11 -19
- data/install.sh +24 -49
- data/installer/unix-like/create_texts.rb +71 -123
- data/installer/unix-like/post_install.sh +3 -0
- data/installer/unix-like/post_uninstall.sh +2 -0
- data/installer/unix-like/pre_install.sh +5 -3
- data/installer/unix-like/pre_uninstall.sh +14 -6
- data/installer/unix-like/rho_connect_install_checkers.rb +1 -1
- data/installer/unix-like/rho_connect_install_constants.rb +6 -10
- data/installer/unix-like/rho_connect_install_debian.rb +2 -2
- data/installer/unix-like/rho_connect_install_dnd.rb +2 -5
- data/installer/unix-like/rho_connect_install_installers.rb +15 -23
- data/installer/unix-like/rho_connect_install_yum.rb +2 -2
- data/installer/utils/constants.rb +4 -4
- data/installer/utils/create_sha1.rb +1 -1
- data/installer/utils/nix_install_test.rb +32 -31
- data/installer/utils/nix_installation.rake +1 -1
- data/installer/utils/package_upload/repos.rake +34 -30
- data/installer/utils/package_upload/s3_upload.rb +3 -3
- data/lib/rhoconnect/api/source/fast_delete.rb +10 -0
- data/lib/rhoconnect/api/source/fast_insert.rb +10 -0
- data/lib/rhoconnect/api/source/fast_update.rb +10 -0
- data/lib/rhoconnect/api/source/get_source_params.rb +1 -1
- data/lib/rhoconnect/api/source/list_sources.rb +2 -2
- data/lib/rhoconnect/api/source/save_adapter.rb +1 -1
- data/lib/rhoconnect/api/source/update_source_params.rb +6 -0
- data/lib/rhoconnect/async.rb +82 -0
- data/lib/rhoconnect/bulk_data/bulk_data.rb +5 -1
- data/lib/rhoconnect/client_sync.rb +18 -3
- data/lib/rhoconnect/console/rhoconnect_api.rb +2 -2
- data/lib/rhoconnect/console/server.rb +5 -32
- data/lib/rhoconnect/console.rb +2 -2
- data/lib/rhoconnect/graph_helper.rb +225 -0
- data/lib/rhoconnect/jobs/bulk_data_job.rb +24 -2
- data/lib/rhoconnect/server.rb +31 -11
- data/lib/rhoconnect/source.rb +10 -5
- data/lib/rhoconnect/source_sync.rb +32 -2
- data/lib/rhoconnect/tasks.rb +19 -108
- data/lib/rhoconnect/test_methods.rb +20 -0
- data/lib/rhoconnect/utilities.rb +118 -0
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect/web-console/controllers/admins.js +245 -0
- data/lib/rhoconnect/web-console/models/adapter.js +53 -0
- data/lib/rhoconnect/web-console/models/client.js +105 -0
- data/lib/rhoconnect/web-console/models/doc.js +113 -0
- data/lib/rhoconnect/web-console/models/session.js +40 -0
- data/lib/rhoconnect/web-console/models/source.js +115 -0
- data/lib/rhoconnect/web-console/models/stats.js +84 -0
- data/lib/rhoconnect/web-console/models/user.js +111 -0
- data/lib/rhoconnect/web-console/public/backbone.js +1432 -0
- data/lib/rhoconnect/web-console/public/bootstrap.css +3990 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/excanvas.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.barRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisLabelRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasAxisTickRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.canvasTextRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.categoryAxisRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.cursor.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.dateAxisRenderer.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jqplot.pointLabels.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery-1.4.2.min.js +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.css +0 -0
- data/lib/rhoconnect/{console/app → web-console}/public/jqplot/jquery.jqplot.min.js +0 -0
- data/lib/rhoconnect/web-console/public/jquery-1.7.1.min.js +154 -0
- data/lib/rhoconnect/web-console/public/rhoconnect-web.js +15 -0
- data/lib/rhoconnect/web-console/public/underscore.js +999 -0
- data/lib/rhoconnect/web-console/server.rb +55 -0
- data/lib/rhoconnect/web-console/templates/index.erb +90 -0
- data/lib/rhoconnect/web-console/templates/jqplot.erb +60 -0
- data/lib/rhoconnect/web-console/views/api_token.js +16 -0
- data/lib/rhoconnect/web-console/views/doc.js +63 -0
- data/lib/rhoconnect/web-console/views/edit_user.js +43 -0
- data/lib/rhoconnect/web-console/views/home.js +56 -0
- data/lib/rhoconnect/web-console/views/index.js +63 -0
- data/lib/rhoconnect/web-console/views/new_ping.js +58 -0
- data/lib/rhoconnect/web-console/views/new_user.js +29 -0
- data/lib/rhoconnect/web-console/views/server_doc.js +103 -0
- data/lib/rhoconnect/web-console/views/set_adapter.js +38 -0
- data/lib/rhoconnect/web-console/views/settings.js +53 -0
- data/lib/rhoconnect/web-console/views/show_device.js +56 -0
- data/lib/rhoconnect/web-console/views/show_user.js +38 -0
- data/lib/rhoconnect/web-console/views/source_docs.js +30 -0
- data/lib/rhoconnect/web-console/views/stats.js +69 -0
- data/lib/rhoconnect/web-console/views/users.js +20 -0
- data/lib/rhoconnect.rb +2 -1
- data/rhoconnect.gemspec +3 -1
- data/spec/api/application/rhoconnect_api_spec.rb +3 -5
- data/spec/api/source/fast_delete_spec.rb +27 -0
- data/spec/api/source/fast_insert_spec.rb +28 -0
- data/spec/api/source/fast_update_spec.rb +51 -0
- data/spec/api/source/get_source_params_spec.rb +1 -0
- data/spec/api/source/update_source_params_spec.rb +24 -0
- data/spec/async_spec.rb +19 -0
- data/spec/client_sync_spec.rb +19 -2
- data/spec/javascripts/PlayerSpec.js +58 -0
- data/spec/javascripts/admins_routes_spec.js +117 -0
- data/spec/javascripts/admins_spec.js +27 -0
- data/spec/javascripts/doc_view_spec.js +37 -0
- data/spec/javascripts/edit_user_view_spec.js +44 -0
- data/spec/javascripts/helpers/SpecHelper.js +9 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +305 -0
- data/spec/javascripts/helpers/jasmine-sinon.js +43 -0
- data/spec/javascripts/helpers/sinon-1.3.2.js +3551 -0
- data/spec/javascripts/home_view_spec.js +39 -0
- data/spec/javascripts/index_view_spec.js +42 -0
- data/spec/javascripts/new_ping_view_spec.js +48 -0
- data/spec/javascripts/new_user_view_spec.js +42 -0
- data/spec/javascripts/server_doc_view_spec.js +39 -0
- data/spec/javascripts/set_adapter_view_spec.js +32 -0
- data/spec/javascripts/show_device_view_spec.js +41 -0
- data/spec/javascripts/show_user_view_spec.js +46 -0
- data/spec/javascripts/source_docs_view_spec.js +36 -0
- data/spec/javascripts/support/jasmine.yml +79 -0
- data/spec/javascripts/support/jasmine_config.rb +23 -0
- data/spec/javascripts/support/jasmine_runner.rb +32 -0
- data/spec/javascripts/users_view_spec.js +35 -0
- data/spec/jobs/bulk_data_job_spec.rb +10 -2
- data/spec/perf/bulk_data_perf_spec.rb +1 -0
- data/spec/server/server_spec.rb +3 -1
- data/spec/source_sync_spec.rb +14 -1
- data/spec/spec_helper.rb +51 -0
- data/spec/store_spec.rb +6 -0
- data/spec/test_methods_spec.rb +11 -0
- data/tasks/redis.rake +3 -1
- metadata +172 -64
- data/doc/contributing.txt +0 -60
- data/lib/rhoconnect/console/app/helpers/auth_helper.rb +0 -22
- data/lib/rhoconnect/console/app/helpers/extensions.rb +0 -19
- data/lib/rhoconnect/console/app/helpers/helpers.rb +0 -57
- data/lib/rhoconnect/console/app/public/ThickBox.css +0 -649
- data/lib/rhoconnect/console/app/public/home.css +0 -431
- data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/header_halo.jpg +0 -0
- data/lib/rhoconnect/console/app/public/images/land_separator.gif +0 -0
- data/lib/rhoconnect/console/app/public/images/landing_header.jpg +0 -0
- data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/tabs_separator.png +0 -0
- data/lib/rhoconnect/console/app/public/main.css +0 -7
- data/lib/rhoconnect/console/app/public/reset.css +0 -76
- data/lib/rhoconnect/console/app/public/style.css +0 -2201
- data/lib/rhoconnect/console/app/public/text.txt +0 -0
- data/lib/rhoconnect/console/app/routes/adapter.rb +0 -28
- data/lib/rhoconnect/console/app/routes/auth.rb +0 -29
- data/lib/rhoconnect/console/app/routes/client.rb +0 -31
- data/lib/rhoconnect/console/app/routes/docs.rb +0 -145
- data/lib/rhoconnect/console/app/routes/heroku.rb +0 -19
- data/lib/rhoconnect/console/app/routes/home.rb +0 -63
- data/lib/rhoconnect/console/app/routes/timing.rb +0 -242
- data/lib/rhoconnect/console/app/routes/user.rb +0 -122
- data/lib/rhoconnect/console/app/views/adapter.erb +0 -16
- data/lib/rhoconnect/console/app/views/client.erb +0 -30
- data/lib/rhoconnect/console/app/views/content.erb +0 -14
- data/lib/rhoconnect/console/app/views/doc.erb +0 -8
- data/lib/rhoconnect/console/app/views/docdata.erb +0 -28
- data/lib/rhoconnect/console/app/views/docs.erb +0 -30
- data/lib/rhoconnect/console/app/views/edituser.erb +0 -13
- data/lib/rhoconnect/console/app/views/headermenu.erb +0 -40
- data/lib/rhoconnect/console/app/views/home.erb +0 -24
- data/lib/rhoconnect/console/app/views/index.erb +0 -58
- data/lib/rhoconnect/console/app/views/jqplot.erb +0 -52
- data/lib/rhoconnect/console/app/views/layout.erb +0 -153
- data/lib/rhoconnect/console/app/views/login.erb +0 -26
- data/lib/rhoconnect/console/app/views/newuser.erb +0 -17
- data/lib/rhoconnect/console/app/views/ping.erb +0 -40
- data/lib/rhoconnect/console/app/views/result.erb +0 -11
- data/lib/rhoconnect/console/app/views/rightboxlinks.erb +0 -15
- data/lib/rhoconnect/console/app/views/select_doc.erb +0 -17
- data/lib/rhoconnect/console/app/views/upload_doc.erb +0 -23
- data/lib/rhoconnect/console/app/views/user.erb +0 -29
- data/lib/rhoconnect/console/app/views/users.erb +0 -19
- data/lib/rhoconnect/server/views/index.erb +0 -13
@@ -32,6 +32,10 @@ optparse = OptionParser.new do |opts|
|
|
32
32
|
options[:web_server] = server
|
33
33
|
end #do
|
34
34
|
|
35
|
+
opts.on('-l', '--Logfile file', ' Specify installtion log file') do |file|
|
36
|
+
options[:log_file] = file
|
37
|
+
end #do
|
38
|
+
|
35
39
|
end #do
|
36
40
|
|
37
41
|
optparse.parse!
|
@@ -42,6 +46,9 @@ optparse.parse!
|
|
42
46
|
@ruby_version = options[:rubyVersion]
|
43
47
|
@profile = (@dist == 'debian') ? '~/.profile' : '~/.bash_profile'
|
44
48
|
@server = options[:web_server]
|
49
|
+
@log_file = options[:log_file]
|
50
|
+
|
51
|
+
@passenger_root = Constants::PASSENGER_ROOT
|
45
52
|
|
46
53
|
def passenger_version
|
47
54
|
(`#{@prefix}/bin/passenger --version`.match /\d+\.\d+\.\d+/)[0]
|
@@ -229,7 +236,6 @@ end
|
|
229
236
|
|
230
237
|
#
|
231
238
|
# Nginx stuff ...
|
232
|
-
|
233
239
|
def create_nginx_init
|
234
240
|
nginx_init_script = <<'_NGINX_INIT_SCRIPT_'
|
235
241
|
#!/bin/sh
|
@@ -300,11 +306,11 @@ _NGINX_INIT_SCRIPT_
|
|
300
306
|
`chmod +x #{nginx_script}`
|
301
307
|
|
302
308
|
# Set run levels
|
303
|
-
# if @dist == 'debian'
|
304
|
-
# #`update-rc.d -f nginx defaults`
|
305
|
-
# else
|
306
|
-
# #`/sbin/chkconfig nginx on`
|
307
|
-
# end
|
309
|
+
# if @dist == 'debian'
|
310
|
+
# #`update-rc.d -f nginx defaults`
|
311
|
+
# else
|
312
|
+
# #`/sbin/chkconfig nginx on`
|
313
|
+
# end
|
308
314
|
|
309
315
|
end
|
310
316
|
|
@@ -329,7 +335,6 @@ end
|
|
329
335
|
def create_nginx_conf_files(app_name)
|
330
336
|
nginx_server_conf = <<'_NGINX_CONF_'
|
331
337
|
user nginx;
|
332
|
-
|
333
338
|
worker_processes 4;
|
334
339
|
|
335
340
|
error_log logs/error.log;
|
@@ -367,28 +372,40 @@ _NGINX_CONF_
|
|
367
372
|
|
368
373
|
Dir.mkdir "/opt/nginx/conf/conf.d" unless File.exist? "/opt/nginx/conf/conf.d"
|
369
374
|
rho_vhost_conf = <<_VHOST_CONF_
|
375
|
+
upstream thin_cluster {
|
376
|
+
server unix:/tmp/thin.sock;
|
377
|
+
#server unix:/tmp/thin.0.sock;
|
378
|
+
#server unix:/tmp/thin.1.sock;
|
379
|
+
#server unix:/tmp/thin.2.sock;
|
380
|
+
#server unix:/tmp/thin.3.sock;
|
381
|
+
}
|
382
|
+
|
370
383
|
server {
|
371
384
|
listen 80;
|
372
385
|
root /opt/nginx/html/#{app_name}/public; # <-- be sure to point to 'public' folder of your application!
|
373
|
-
|
374
|
-
#
|
375
|
-
|
376
|
-
|
386
|
+
# access_log off; # <-- disable access logging
|
387
|
+
# error_log /dev/null crit; # <-- disable error logging, but critical errors only
|
388
|
+
|
389
|
+
location / {
|
390
|
+
proxy_set_header X-Real-IP $remote_addr;
|
391
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
392
|
+
proxy_set_header Host $http_host;
|
393
|
+
proxy_redirect off;
|
394
|
+
|
395
|
+
proxy_pass http://thin_cluster;
|
396
|
+
}
|
397
|
+
|
398
|
+
error_page 500 502 503 504 /50x.html;
|
399
|
+
location = /50x.html {
|
400
|
+
root html;
|
401
|
+
}
|
402
|
+
}
|
377
403
|
_VHOST_CONF_
|
378
|
-
File.open('/opt/nginx/conf/conf.d/rhoconnect.conf', 'w' ) { |f| f << rho_vhost_conf }
|
379
404
|
|
380
|
-
|
381
|
-
passenger_root /opt/rhoconnect/lib/ruby/gems/1.8/gems/passenger-#{passenger_version};
|
382
|
-
passenger_ruby /opt/rhoconnect/bin/ruby;
|
383
|
-
passenger_max_pool_size 20;
|
384
|
-
passenger_min_instances 6;
|
385
|
-
_PASSENGER_CONF_
|
386
|
-
File.open('/opt/nginx/conf/conf.d/passenger.conf', 'w' ) { |f| f << passenger_conf }
|
405
|
+
File.open('/opt/nginx/conf/conf.d/rhoconnect.conf', 'w' ) { |f| f << rho_vhost_conf }
|
387
406
|
end
|
388
|
-
|
389
407
|
# End of nginx stuff ...
|
390
408
|
|
391
|
-
|
392
409
|
# generate_common_info
|
393
410
|
# Generates the readme info that is common across all distributions
|
394
411
|
def generate_common_info
|
@@ -456,87 +473,6 @@ _README2_
|
|
456
473
|
readme
|
457
474
|
end #generate_common_info
|
458
475
|
|
459
|
-
def create_passenger_load
|
460
|
-
if @dist == 'debian'
|
461
|
-
passenger_load_file = '/etc/apache2/mods-available/passenger.load'
|
462
|
-
else
|
463
|
-
passenger_load_file = '/etc/httpd/conf.d/passenger.conf'
|
464
|
-
end # if
|
465
|
-
|
466
|
-
passenger_load = <<_PASSENGER_LOAD_
|
467
|
-
LoadModule passenger_module /opt/rhoconnect/lib/ruby/gems/1.8/gems/passenger-#{passenger_version}/ext/apache2/mod_passenger.so
|
468
|
-
PassengerRoot /opt/rhoconnect/lib/ruby/gems/1.8/gems/passenger-#{passenger_version}
|
469
|
-
PassengerRuby /opt/rhoconnect/bin/ruby
|
470
|
-
_PASSENGER_LOAD_
|
471
|
-
|
472
|
-
File.open( passenger_load_file, 'w' ) { |f| f << passenger_load }
|
473
|
-
end #create_passenger_load
|
474
|
-
|
475
|
-
def create_apache_vhost
|
476
|
-
if @dist == 'debian'
|
477
|
-
vhost_file = '/etc/apache2/sites-available/rhoconnect'
|
478
|
-
else
|
479
|
-
vhost_file = '/etc/httpd/conf.d/rhoconnect.conf'
|
480
|
-
end
|
481
|
-
vhost = <<_VHOST_
|
482
|
-
<VirtualHost *:80>
|
483
|
-
ServerName www.yourhost.com
|
484
|
-
DocumentRoot /var/www/rhoapp/public
|
485
|
-
PassengerMaxPoolSize 20
|
486
|
-
PassengerMinInstances 6
|
487
|
-
#...
|
488
|
-
<Directory /var/www/rhoconnect/public>
|
489
|
-
AllowOverride all
|
490
|
-
Options -MultiViews
|
491
|
-
</Directory>
|
492
|
-
</VirtualHost>
|
493
|
-
_VHOST_
|
494
|
-
|
495
|
-
File.open( vhost_file, 'w' ) { |f| f << vhost }
|
496
|
-
end #create_apache_vhost
|
497
|
-
|
498
|
-
# The debian Apache2 specific part of the readme and places it in options[:prefix]
|
499
|
-
def debian_apache_readme
|
500
|
-
readme = <<_README_
|
501
|
-
4) Installer created the following Apache2 configuration files:
|
502
|
-
- rhoconnect application template (/etc/apache2/sites-available/rhoconnect)
|
503
|
-
- passenger module (/etc/apache2/mods-available/passenger.load)
|
504
|
-
|
505
|
-
To complete setup of web server
|
506
|
-
A) Configure virtual host for rhoconnect application:
|
507
|
-
Edit the file /etc/apache2/sites-available/rhoconnect so that it reflects your specifications.
|
508
|
-
|
509
|
-
B) Enable the virtual host:
|
510
|
-
sudo a2ensite rhoconnect
|
511
|
-
|
512
|
-
C) Load the passenger.load module
|
513
|
-
sudo a2enmod passenger
|
514
|
-
|
515
|
-
D) Start server to pick up the changes:
|
516
|
-
sudo /etc/init.d/apache2 start
|
517
|
-
_README_
|
518
|
-
|
519
|
-
readme
|
520
|
-
end
|
521
|
-
|
522
|
-
# The non-debian Apache2 specific part of the readme file and places it in options[:prefix]
|
523
|
-
def yum_apache_readme
|
524
|
-
readme = <<_README_
|
525
|
-
4) Installer created the following Apache2 configuration files:
|
526
|
-
- rhoconnect application template (/etc/httpd/conf.d/rhoconnect.conf)
|
527
|
-
- passenger module (/etc/httpd/conf.d/passenger.conf)
|
528
|
-
|
529
|
-
To complete setup of web server
|
530
|
-
A) Configure virtual host for rhoconnect application:
|
531
|
-
Edit the file /etc/httpd/conf.d/rhoconnect.conf so that it reflects your specifications.
|
532
|
-
|
533
|
-
B) As root user start server to pick up the changes:
|
534
|
-
/sbin/service httpd start
|
535
|
-
_README_
|
536
|
-
|
537
|
-
readme
|
538
|
-
end
|
539
|
-
|
540
476
|
def nginx_readme
|
541
477
|
readme = <<_NGINX_README_
|
542
478
|
4) Installer compiled Nginx web server (/opt/nginx) with the following configuration files:
|
@@ -587,6 +523,30 @@ def copy_benchapp(rho_path)
|
|
587
523
|
`chown -R nginx:nginx benchapp/`
|
588
524
|
end
|
589
525
|
|
526
|
+
def config_and_install_thin_scripts(rho_path)
|
527
|
+
puts "Configuring and installing thin scripts ..."
|
528
|
+
`#{rho_path}/bin/thin install`
|
529
|
+
|
530
|
+
# >> Installing thin service at /etc/rc.d/thin ...
|
531
|
+
# mkdir -p /etc/rc.d
|
532
|
+
# writing /etc/rc.d/thin
|
533
|
+
# chmod +x /etc/rc.d/thin
|
534
|
+
# mkdir -p /etc/thin
|
535
|
+
#
|
536
|
+
# To configure thin to start at system boot:
|
537
|
+
# on RedHat like systems:
|
538
|
+
# sudo /sbin/chkconfig --level 345 thin on
|
539
|
+
# on Debian-like systems (Ubuntu):
|
540
|
+
# sudo /usr/sbin/update-rc.d -f thin defaults
|
541
|
+
# on Gentoo:
|
542
|
+
# sudo rc-update add thin default
|
543
|
+
#
|
544
|
+
# Then put your config files in /etc/thin
|
545
|
+
|
546
|
+
`#{rho_path}/bin/thin config -C /etc/thin/rhoapp.yml -c /opt/nginx/html/rhoapp/ --socket /tmp/thin.sock --log /opt/nginx/logs/thin.log --pid /var/run/thin.pid -e production`
|
547
|
+
`ln -s /etc/rc.d/thin /etc/init.d/.` if File.directory?('/etc/rc.d')
|
548
|
+
end
|
549
|
+
|
590
550
|
def create_texts
|
591
551
|
if @redis
|
592
552
|
create_redis_init
|
@@ -595,8 +555,8 @@ def create_texts
|
|
595
555
|
|
596
556
|
if @server == 'nginx'
|
597
557
|
create_nginx_init
|
598
|
-
|
599
558
|
create_nginx_logrotate
|
559
|
+
|
600
560
|
@use_bench_app = File.exist? "#{@prefix}/installer/bench.tar.gz"
|
601
561
|
if @use_bench_app
|
602
562
|
create_nginx_conf_files "benchapp"
|
@@ -605,12 +565,8 @@ def create_texts
|
|
605
565
|
create_nginx_conf_files "rhoapp"
|
606
566
|
generate_rhoapp @prefix
|
607
567
|
end
|
608
|
-
|
568
|
+
config_and_install_thin_scripts(@prefix)
|
609
569
|
distro_info = nginx_readme
|
610
|
-
else
|
611
|
-
create_passenger_load
|
612
|
-
create_apache_vhost
|
613
|
-
distro_info = (@dist == 'debian') ? debian_apache_readme : yum_apache_readme
|
614
570
|
end
|
615
571
|
|
616
572
|
common_info = generate_common_info
|
@@ -641,30 +597,22 @@ _IT_SHOULD_BE_DONE_
|
|
641
597
|
|
642
598
|
_NGINX_TO_DO_
|
643
599
|
else
|
644
|
-
|
645
|
-
server_todo_list = <<_NGINX_TO_DO_
|
600
|
+
server_todo_list = <<_NGINX_TO_DO_
|
646
601
|
2) Try rhoconnect 'rhoapp' application, created in /opt/nginx/html directory
|
647
602
|
A) As root user start redis and nginx servers:
|
648
603
|
/etc/init.d/redis start
|
649
604
|
/etc/init.d/nginx start
|
605
|
+
/etc/init.d/thin start
|
650
606
|
B) Open RhoConnect application web console in your browser:
|
651
607
|
http://localhost/console/
|
652
608
|
|
653
609
|
_NGINX_TO_DO_
|
654
|
-
else
|
655
|
-
server_todo_list = <<_APACHE2_TO_DO_
|
656
|
-
2) Complete setup of Apache2 web server
|
657
|
-
A) Configure virtual host for your rhoconnect application:
|
658
|
-
Edit the file /etc/httpd/conf.d/rhoconnect.conf so that it reflects your specifications.
|
659
|
-
B) As root user start server to pick up the changes:
|
660
|
-
/sbin/service httpd start
|
661
|
-
|
662
|
-
_APACHE2_TO_DO_
|
663
|
-
end
|
664
610
|
end
|
665
611
|
|
666
|
-
|
667
|
-
|
668
|
-
|
612
|
+
afterwords << about_app
|
613
|
+
afterwords << "For more details see #{@prefix}/README file."
|
614
|
+
puts afterwords
|
615
|
+
File.open("#{@log_file}", 'a') { |f| f << afterwords } if @log_file
|
616
|
+
end
|
669
617
|
|
670
618
|
create_texts
|
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
#echo "before_install script is running ..."
|
4
|
+
|
5
|
+
#if [ -d "/opt/rhoconnect" ]; then
|
6
|
+
# rm -rf /opt/rhoconnect
|
7
|
+
#fi
|
6
8
|
|
7
9
|
#if [ -d "/opt/nginx" ]; then
|
8
10
|
# rm -rf /opt/nginx
|
@@ -1,23 +1,31 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
#echo "before_remove script is running ..."
|
4
|
+
echo "Stopping rhoconnect services and remove init scripts ..."
|
5
|
+
|
3
6
|
# Stop redis
|
4
7
|
if [ -e "/etc/init.d/redis" ]; then
|
5
8
|
/etc/init.d/redis stop
|
6
|
-
if [[ `which dpkg 2> /dev/null` != "" ]]; then
|
9
|
+
if [[ `which dpkg 2> /dev/null` != "" ]]; then # Debian
|
7
10
|
update-rc.d -f redis remove
|
8
|
-
elif [[ `which rpm 2> /dev/null` != "" ]]; then
|
11
|
+
elif [[ `which rpm 2> /dev/null` != "" ]]; then # Red Hat
|
9
12
|
/sbin/chkconfig redis off
|
10
13
|
fi
|
11
14
|
fi
|
12
15
|
|
16
|
+
#stop thin
|
17
|
+
if [ -e "/etc/init.d/thin" ]; then /etc/init.d/thin stop; fi
|
18
|
+
|
13
19
|
#stop nginx
|
14
|
-
if [ -e "/etc/init.d/nginx" ]; then
|
15
|
-
/etc/init.d/nginx stop
|
16
|
-
fi
|
20
|
+
if [ -e "/etc/init.d/nginx" ]; then /etc/init.d/nginx stop; fi
|
17
21
|
|
18
|
-
|
22
|
+
#/etc/logrotate.d/redis
|
19
23
|
rm -f /etc/init.d/redis
|
20
24
|
rm -f /etc/logrotate.d/redis
|
21
25
|
|
22
26
|
rm -f /etc/init.d/nginx
|
23
27
|
rm -f /etc/logrotate.d/nginx
|
28
|
+
|
29
|
+
rm -f /etc/thin/rhoapp.yml
|
30
|
+
rm -f /etc/rc.d/thin
|
31
|
+
rm -f /etc/init.d/thin
|
@@ -8,23 +8,19 @@ module Constants
|
|
8
8
|
"libaprutil1-dev",
|
9
9
|
"dtach"]
|
10
10
|
|
11
|
+
RUBY = "ruby-1.9.3-p125"
|
11
12
|
REDIS = "redis-2.4.10"
|
12
13
|
SQLITE3 = "sqlite-autoconf-3071000"
|
14
|
+
NGINX = "nginx-1.0.15"
|
15
|
+
PASSENGER_ROOT = "/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/passenger"
|
13
16
|
|
14
|
-
|
15
|
-
Nginx = "nginx-1.0.14"
|
16
|
-
|
17
|
-
SOFTWARE = [ REDIS, SQLITE3, RUBY, Nginx ]
|
17
|
+
SOFTWARE = [ REDIS, SQLITE3, RUBY, NGINX ]
|
18
18
|
|
19
19
|
REDIS_URL = "http://redis.googlecode.com/files/#{ REDIS }.tar.gz"
|
20
20
|
SQLITE3_URL = "http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz"
|
21
|
-
|
22
21
|
URLS = [ REDIS_URL, SQLITE3_URL ]
|
23
|
-
|
24
|
-
|
25
|
-
GEMS = ["bundler", "passenger",
|
26
|
-
"thor", "ffaker"] # thor and ffaker required by rhoconnect-benchmark utility
|
27
|
-
|
22
|
+
GEMS = ["bundler", "thin", "foreman"]
|
23
|
+
|
28
24
|
SUPPORTED_PKG_MGRS = ["apt-get", "yum"]
|
29
25
|
SUPPORTED_WEB_SERVERS = ["apache2", "nginx"]
|
30
26
|
|
@@ -15,9 +15,6 @@ module DownloadAndDocompress
|
|
15
15
|
downloads += 1
|
16
16
|
end #if
|
17
17
|
end #do
|
18
|
-
# if downloads == 0
|
19
|
-
# log_print "Nothing additional to download"
|
20
|
-
# end #if
|
21
18
|
end #download_and_decompress
|
22
19
|
|
23
20
|
# wget_download
|
@@ -26,7 +23,7 @@ module DownloadAndDocompress
|
|
26
23
|
def wget_download(prefix, url)
|
27
24
|
if !File.exists?("#{ prefix }/#{ get_tarball_name url }") &&
|
28
25
|
!File.directory?("#{ prefix }/#{ get_version url }")
|
29
|
-
|
26
|
+
cmd "wget -P #{prefix} #{url} -o /dev/null"
|
30
27
|
end #if
|
31
28
|
end #wget_download
|
32
29
|
|
@@ -36,7 +33,7 @@ module DownloadAndDocompress
|
|
36
33
|
def decompress(prefix, url)
|
37
34
|
tarball = get_tarball_name(url)
|
38
35
|
dir = get_version(url)
|
39
|
-
cmd "tar -xzf #{
|
36
|
+
cmd "tar -xzf #{prefix}/#{tarball} -C #{prefix} > /dev/null 2>&1" unless File.directory? "#{prefix}/#{dir}"
|
40
37
|
end #decompress
|
41
38
|
|
42
39
|
# get_version
|
@@ -4,32 +4,24 @@ require 'rho_connect_install_checkers'
|
|
4
4
|
include Checkers
|
5
5
|
|
6
6
|
module Installers
|
7
|
-
|
8
|
-
# This method installs items that were retrieved via wget as well as passenger
|
9
|
-
def configure_passenger(options)
|
7
|
+
def configure_nginx(options)
|
10
8
|
raise "Please stop the web server and then reinstall the package." if check_web_server_running
|
11
|
-
|
12
9
|
@options=options
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
--nginx-source-dir=#{@options[:prefix]}/#{nginx_version} \
|
25
|
-
--extra-configure-flags='--with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx'"
|
26
|
-
else
|
27
|
-
raise "Unsupported web server."
|
28
|
-
end
|
10
|
+
if @options[:web_server] && @options[:web_server] == "nginx"
|
11
|
+
nginx_version = Constants::NGINX
|
12
|
+
print_header "Downloading http://nginx.org/download/#{nginx_version}.tar.gz ..."
|
13
|
+
cmd "cd #{@options[:prefix]}; wget http://nginx.org/download/#{nginx_version}.tar.gz -o /dev/null; tar -xzvf #{nginx_version}.tar.gz"
|
14
|
+
print_header "Configuring and compiling Nginx web server ..."
|
15
|
+
|
16
|
+
Dir.chdir("#{@options[:prefix]}/#{nginx_version}")
|
17
|
+
cmd "./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --user=nginx --group=nginx"
|
18
|
+
cmd "make 2>&1; make install"
|
19
|
+
else
|
20
|
+
raise "Inernal error: only nginx is supported."
|
29
21
|
end
|
30
22
|
raise "Nginx installation failed." if $? != 0
|
31
23
|
end
|
32
|
-
|
24
|
+
|
33
25
|
# install_all_gems
|
34
26
|
# This method installs all gems specified in the GEMS list defined in the
|
35
27
|
# Constants file
|
@@ -90,7 +82,7 @@ module Installers
|
|
90
82
|
# install_sqlite
|
91
83
|
# This method instaqll sqlite
|
92
84
|
def install_sqlite
|
93
|
-
print_header "Installing sqlite3
|
85
|
+
print_header "Installing sqlite3 ..."
|
94
86
|
Dir.chdir("#{@options[:prefix]}/#{Constants::SQLITE3}")
|
95
87
|
cmd "./configure --prefix=#{@options[:prefix]}"
|
96
88
|
cmd "make 2>&1; make install"
|
@@ -100,7 +92,7 @@ module Installers
|
|
100
92
|
# install_rhoconnect
|
101
93
|
# This method installs rhoconnect
|
102
94
|
def install_rhoconnect
|
103
|
-
print_header "
|
95
|
+
print_header "\nInstalling rhoconnect ..."
|
104
96
|
Dir.chdir(@options[:start_dir])
|
105
97
|
|
106
98
|
cmd "#{@options[:prefix]}/bin/bundle config build.sqlite3 " +
|
@@ -17,14 +17,14 @@ module Constants
|
|
17
17
|
:key_name => 'jenkinskey',
|
18
18
|
:groups => 'load-test',
|
19
19
|
:user => 'ubuntu'}
|
20
|
-
|
20
|
+
|
21
21
|
CENTOS_STACK = { :image_id => 'ami-13346656',
|
22
22
|
:flavor_id => 'c1.medium',
|
23
23
|
:key_name => 'jenkinskey',
|
24
24
|
:groups => 'load-test',
|
25
25
|
:user => 'root'}
|
26
26
|
|
27
|
-
STACKS = [ UBUNTU_STACK,
|
27
|
+
STACKS = [ UBUNTU_STACK,
|
28
28
|
CENTOS_STACK ]
|
29
29
|
|
30
30
|
DEB_DEPS = [ "build-essential",
|
@@ -34,11 +34,11 @@ module Constants
|
|
34
34
|
"libreadline5-dev",
|
35
35
|
"libsqlite3-0",
|
36
36
|
"libsqlite3-dev" ]
|
37
|
-
|
37
|
+
|
38
38
|
RPM_DEPS = [ "gcc-c++",
|
39
39
|
"zlib-devel",
|
40
40
|
"curl-devel",
|
41
41
|
"pcre-devel",
|
42
42
|
"openssl-devel",
|
43
|
-
"readline-devel" ]
|
43
|
+
"readline-devel" ]
|
44
44
|
end #Constants
|