rhoconnect 3.0.0.beta1 → 3.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +16 -2
- data/Gemfile +14 -5
- data/Gemfile.lock +13 -23
- data/Rakefile +86 -0
- data/bench/bench_runner.rb +5 -4
- data/bench/benchapp/Gemfile +17 -8
- data/bench/blobapp/Gemfile +13 -14
- data/doc/adapters-crm.txt +226 -0
- data/doc/adapters-intro.txt +18 -0
- data/doc/client.txt +29 -2
- data/doc/heroku-addon.txt +54 -0
- data/doc/install.txt +1 -2
- data/doc/migration.txt +18 -6
- data/doc/net-plugin.txt +276 -0
- data/doc/plugin-intro.txt +6 -0
- data/doc/push.txt +1 -1
- data/doc/rails-plugin.txt +116 -0
- data/doc/rest-api.txt +2 -2
- data/doc/settings.txt +59 -0
- data/doc/tutorial.txt +8 -5
- data/generators/rhoconnect.rb +30 -0
- data/generators/templates/application/Gemfile +16 -7
- data/generators/templates/application/gitignore +4 -0
- data/install.sh +74 -106
- data/installer/deb-scripts/LICENSE +75 -0
- data/installer/deb-scripts/install.sh +300 -0
- data/installer/deb-scripts/scripts/rho_connect_install_constants.rb +32 -0
- data/installer/deb-scripts/scripts/rho_connect_install_installers.rb +103 -0
- data/installer/deb-scripts/scripts/rho_connect_install_utilities.rb +110 -0
- data/installer/deb-scripts/scripts/rhoinstaller.rb +55 -0
- data/installer/deb-scripts/utils/README +67 -0
- data/installer/deb-scripts/utils/create_texts.rb +76 -0
- data/installer/deb-scripts/utils/redis_init_script +124 -0
- data/installer/deb-scripts/utils/redis_log_rotate +8 -0
- data/installer/unix-like/install.sh +361 -0
- data/installer/unix-like/post-install.sh +8 -0
- data/installer/unix-like/pre-install.sh +8 -0
- data/installer/unix-like/rho_connect_install_constants.rb +9 -14
- data/installer/unix-like/rho_connect_install_debian.rb +7 -5
- data/installer/unix-like/rho_connect_install_dnd.rb +6 -6
- data/installer/unix-like/rho_connect_install_get_params.rb +1 -1
- data/installer/unix-like/rho_connect_install_installers.rb +39 -38
- data/installer/unix-like/rho_connect_install_utilities.rb +9 -10
- data/installer/unix-like/rho_connect_install_yum.rb +6 -5
- data/installer/unix-like/rhoinstaller.rb +8 -3
- data/installer/utils/create_texts.rb +313 -85
- data/installer/windows/rhosync.nsi +5 -5
- data/lib/rhoconnect/api/application/clientcreate.rb +1 -1
- data/lib/rhoconnect/api/application/clientregister.rb +1 -1
- data/lib/rhoconnect/api/application/clientreset.rb +1 -1
- data/lib/rhoconnect/client.rb +0 -1
- data/lib/rhoconnect/client_sync.rb +1 -0
- data/lib/rhoconnect/console/app/routes/home.rb +1 -1
- data/lib/rhoconnect/console/app/routes/user.rb +8 -3
- data/lib/rhoconnect/console/app/views/adapter.erb +2 -2
- data/lib/rhoconnect/console/app/views/ping.erb +14 -2
- data/lib/rhoconnect/console/app/views/users.erb +8 -1
- data/lib/rhoconnect/jobs/ping_job.rb +11 -3
- data/lib/rhoconnect/model.rb +2 -2
- data/lib/rhoconnect/read_state.rb +2 -0
- data/lib/rhoconnect/server.rb +4 -3
- data/lib/rhoconnect/source.rb +33 -6
- data/lib/rhoconnect/source_adapter.rb +5 -9
- data/lib/rhoconnect/source_sync.rb +11 -5
- data/lib/rhoconnect/store.rb +7 -4
- data/lib/rhoconnect/tasks.rb +3 -3
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect.rb +22 -8
- data/rhoconnect.gemspec +4 -22
- data/spec/api/application/rhoconnect_api_spec.rb +54 -8
- data/spec/api/source/get_source_params_spec.rb +2 -1
- data/spec/api/source/list_sources_spec.rb +3 -3
- data/spec/app_spec.rb +8 -1
- data/spec/apps/rhotestapp/settings/settings.yml +10 -5
- data/spec/apps/rhotestapp/sources/other_adapter.rb +7 -0
- data/spec/client_sync_spec.rb +5 -8
- data/spec/dynamic_adapter_spec.rb +8 -8
- data/spec/generator/generator_spec.rb +4 -2
- data/spec/jobs/ping_job_spec.rb +53 -0
- data/spec/model_spec.rb +2 -2
- data/spec/rhosync_spec.rb +1 -1
- data/spec/server/server_spec.rb +3 -14
- data/spec/source_sync_spec.rb +84 -2
- data/spec/support/shared_examples.rb +2 -2
- data/tasks/redis.rake +2 -2
- metadata +30 -41
- data/spec/api/rhosync_api_spec.rb.orig +0 -606
@@ -8,29 +8,34 @@ module Installers
|
|
8
8
|
@options=''
|
9
9
|
|
10
10
|
# configure_passenger
|
11
|
-
# This method installs items that were retrieved via wget as well as
|
12
|
-
# passenger
|
11
|
+
# This method installs items that were retrieved via wget as well as passenger
|
13
12
|
def configure_passenger(options)
|
14
13
|
@options=options
|
15
|
-
installs = 0
|
16
14
|
print_header "Configuring Passenger"
|
17
15
|
if @options[:web_server] && !check_web_server_running
|
18
16
|
if @options[:web_server] == "apache2"
|
19
17
|
print_header "Configuring Apache2 to work with Passenger"
|
18
|
+
cmd "yes | #{@options[:prefix]}/bin/passenger-install-#{ @options[:web_server] }-module"
|
20
19
|
elsif @options[:web_server] == "nginx"
|
21
|
-
print_header "Configuring Nginx to work with Passenger"
|
20
|
+
print_header "Configuring and Compiling Nginx to work with Passenger"
|
21
|
+
nginx_version = Constants::Nginx
|
22
|
+
cmd "cd #{@options[:prefix]}; wget http://nginx.org/download/#{nginx_version}.tar.gz; tar -xzvf #{nginx_version}.tar.gz"
|
23
|
+
cmd "#{@options[:prefix]}/bin/passenger-install-nginx-module --auto --prefix=/opt/nginx \
|
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'"
|
22
26
|
else
|
23
27
|
log_print "That web server is not yet supported. Sorry..."
|
28
|
+
exit
|
24
29
|
end #if
|
25
30
|
end #if
|
26
|
-
cmd "yes | #{@options[:prefix]}bin/passenger-install-#{ @options[:web_server] }-module"
|
27
31
|
|
28
32
|
if $? != 0
|
29
33
|
log_print "Some dependencies are not installed.\nPlease install them and re-run this script..."
|
30
34
|
exit
|
31
|
-
else
|
32
|
-
cmd "echo passenger >> #{@options[:prefix]}installchecklist"
|
33
35
|
end #if
|
36
|
+
# FIXME:
|
37
|
+
cmd "rm -rf #{@options[:prefix]}/#{nginx_version}; rm #{@options[:prefix]}/#{nginx_version}.tar.gz" if File.exist? "#{@options[:prefix]}/#{nginx_version}.tar.gz"
|
38
|
+
|
34
39
|
end #configure_passenger
|
35
40
|
|
36
41
|
# install_all_packages
|
@@ -59,44 +64,37 @@ module Installers
|
|
59
64
|
# This method installs all gems specified in the GEMS list defined in the
|
60
65
|
# Constants file
|
61
66
|
def install_all_gems
|
62
|
-
gem_path = "#{@options[:prefix]}bin/gem"
|
67
|
+
@gem_path = "#{@options[:prefix]}/bin/gem"
|
63
68
|
Constants::GEMS.each do |gem|
|
64
|
-
install_gem gem
|
69
|
+
install_gem gem
|
65
70
|
end #do
|
66
71
|
end #install_all_gems
|
67
72
|
|
68
73
|
# install_gem
|
69
74
|
# This method installs the given gem unless it is already installed
|
70
|
-
def install_gem(gem
|
71
|
-
|
72
|
-
sqlite3_cmd= "export LD_LIBRARY_PATH=#{@options[:prefix]}lib; #{@options[:prefix]}bin/gem install sqlite3 --no-ri --no-rdoc -- --with-sqlite3-include=#{@options[:prefix]}include"
|
73
|
-
cmd sqlite3_cmd
|
74
|
-
else
|
75
|
-
cmd "#{@gem_path} install #{ gem } --no-ri --no-rdoc" unless check_gem gem, @gem_path
|
76
|
-
end
|
75
|
+
def install_gem(gem)
|
76
|
+
cmd "#{@gem_path} install #{ gem } --no-ri --no-rdoc" unless check_gem gem, @gem_path
|
77
77
|
end #install_gem
|
78
78
|
|
79
79
|
# install_rubygems
|
80
80
|
# This method installs rubygems which was downloaded and untarred earlier
|
81
81
|
def install_rubygems
|
82
82
|
print_header "Installing Rubygems"
|
83
|
-
Dir.chdir("#{@options[:prefix]}
|
84
|
-
cmd "#{@options[:prefix]}bin/ruby setup.rb --prefix=#{@options[:prefix]}
|
85
|
-
@gem_path = "#{@options[:prefix]}bin/gem"
|
86
|
-
cmd "sed -n '1 c\#!/opt/rhoconnect/bin/ruby' #{@options[:prefix]}bin/gem"
|
87
|
-
@gem="#{@options[:prefix]}bin/gem"
|
88
|
-
cmd "echo rubygems >> #{@options[:prefix]}installchecklist"
|
83
|
+
Dir.chdir("#{@options[:prefix]}/#{Constants::RUBYGEMS}")
|
84
|
+
cmd "#{@options[:prefix]}/bin/ruby setup.rb --prefix=#{@options[:prefix]}/#{Constants::RUBYGEMS}"
|
85
|
+
@gem_path = "#{@options[:prefix]}/bin/gem"
|
86
|
+
cmd "sed -n '1 c\#!/opt/rhoconnect/bin/ruby' #{@options[:prefix]}/bin/gem"
|
89
87
|
end #install_rubygems
|
90
88
|
|
91
89
|
# install_redis
|
92
90
|
# This method installs redis
|
93
91
|
def install_redis
|
94
|
-
Dir.chdir("#{@options[:prefix]}
|
92
|
+
Dir.chdir("#{@options[:prefix]}/#{Constants::REDIS}/src")
|
95
93
|
cmd "make; make PREFIX=#{@options[:prefix]} install"
|
96
|
-
cmd "mkdir #{@options[:prefix]}etc" unless File.exist? "#{@options[:prefix]}etc"
|
94
|
+
cmd "mkdir #{@options[:prefix]}/etc" unless File.exist? "#{@options[:prefix]}/etc"
|
97
95
|
|
98
96
|
#cmd "cp ../redis.conf #{@options[:prefix]}etc"
|
99
|
-
redis_conf_file = File.new("#{@options[:prefix]}etc/redis.conf", 'w')
|
97
|
+
redis_conf_file = File.new("#{@options[:prefix]}/etc/redis.conf", 'w')
|
100
98
|
File.foreach("../redis.conf") do |line|
|
101
99
|
# daemonize no --> daemonize yes
|
102
100
|
# logfile stdout --> logfile /var/log/redis.log
|
@@ -109,17 +107,14 @@ module Installers
|
|
109
107
|
end
|
110
108
|
end
|
111
109
|
redis_conf_file.close
|
112
|
-
|
113
|
-
cmd "echo redis >> #{@options[:prefix]}installchecklist"
|
114
110
|
end #install_redis
|
115
111
|
|
116
112
|
# install_sqlite
|
117
113
|
# This method instaqll sqlite
|
118
114
|
def install_sqlite
|
119
|
-
Dir.chdir("#{@options[:prefix]}
|
115
|
+
Dir.chdir("#{@options[:prefix]}/#{Constants::SQLITE3}")
|
120
116
|
cmd "./configure --prefix=#{@options[:prefix]}"
|
121
117
|
cmd "make; make install"
|
122
|
-
cmd "echo sqlite >> #{@options[:prefix]}installchecklist"
|
123
118
|
end #install_sqlite
|
124
119
|
|
125
120
|
# install_rhoconnect
|
@@ -127,16 +122,22 @@ module Installers
|
|
127
122
|
def install_rhoconnect
|
128
123
|
# start installations
|
129
124
|
# store current gem_path
|
130
|
-
orig_gem_path = `which gem`
|
125
|
+
# orig_gem_path = `which gem`
|
131
126
|
print_header "Installing Rhoconnect"
|
127
|
+
path_to_rc_gem = "/tmp/installdir/rhoconnect-#{@options[:version]}/rhoconnect-#{@options[:version]}.gem"
|
128
|
+
|
132
129
|
Dir.chdir(@options[:start_dir])
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
130
|
+
if File.exists?(path_to_rc_gem)
|
131
|
+
install_gem path_to_rc_gem
|
132
|
+
else
|
133
|
+
cmd "#{@options[:prefix]}/bin/bundle config build.sqlite3 " +
|
134
|
+
"--with-sqlite3-include=#{@options[:prefix]}/include " +
|
135
|
+
"--with-sqlite3-lib=#{@options[:prefix]}/lib" if @options[:pkg_mgr] =~ /yum/ # CentOS
|
136
|
+
cmd "#{@options[:prefix]}/bin/bundle install --system --binstubs=/opt/rhoconnect/bin --without=test development"
|
137
|
+
# PATH=/opt/rhoconnect/bin:$PATH rake build
|
138
|
+
cmd "PATH=#{@options[:prefix]}/bin:$PATH rake build"
|
139
|
+
cmd "#{@gem_path} install pkg/rhoconnect-*.gem --no-ri --no-rdoc"
|
140
|
+
`rm -f pkg/rhoconnect-*.gem`
|
141
|
+
end #if
|
141
142
|
end #install_rhoconnect
|
142
143
|
end #Installers
|
@@ -47,7 +47,7 @@ module Utilities
|
|
47
47
|
# This method issues the given system command and calls log_print for output
|
48
48
|
def cmd(cmd)
|
49
49
|
log_print cmd
|
50
|
-
log_print `#{
|
50
|
+
log_print `#{cmd}`
|
51
51
|
end #cmd
|
52
52
|
|
53
53
|
#set_log_file
|
@@ -71,15 +71,14 @@ module Utilities
|
|
71
71
|
# cleanup
|
72
72
|
# This method moves all compressed files from the installation directory
|
73
73
|
# that were downloaded by this installation process
|
74
|
-
def cleanup(prefix
|
74
|
+
def cleanup(prefix)
|
75
75
|
print_header "Cleaning up"
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
end #if
|
83
|
-
end # do
|
76
|
+
Constants::SOFTWARE.each do |sw|
|
77
|
+
if File.exist? "#{prefix}/#{sw}.tar.gz"
|
78
|
+
cmd "rm #{prefix}/#{sw}.tar.gz"
|
79
|
+
cmd "rm -rf #{prefix}/#{sw}"
|
80
|
+
end
|
81
|
+
end
|
84
82
|
end #cleanup
|
83
|
+
|
85
84
|
end #Utilities
|
@@ -26,12 +26,13 @@ class Yum
|
|
26
26
|
set_log_file @options[:log]
|
27
27
|
|
28
28
|
#gather necessary files
|
29
|
-
download_and_decompress
|
29
|
+
download_and_decompress(@options[:prefix], [Constants::REDIS_URL, Constants::SQLITE3_URL])
|
30
30
|
|
31
|
-
#
|
32
|
-
install_rubygems
|
31
|
+
# ruby gems is installed by the REE installer
|
32
|
+
# install_rubygems
|
33
33
|
install_redis if @options[:redis]
|
34
|
-
|
34
|
+
# Cent OS uses obsolete sqlite3 libs, update them the latest ones
|
35
|
+
install_sqlite
|
35
36
|
|
36
37
|
#start installing
|
37
38
|
install_all_gems
|
@@ -41,7 +42,7 @@ class Yum
|
|
41
42
|
install_rhoconnect
|
42
43
|
|
43
44
|
#remove downloaded tarballs
|
44
|
-
cleanup options[:prefix]
|
45
|
+
cleanup options[:prefix]
|
45
46
|
end #execute_installation
|
46
47
|
|
47
48
|
# to_s
|
@@ -54,9 +54,14 @@ optparse = OptionParser.new do|opts|
|
|
54
54
|
opts.on( '-s', '--silent', 'Perform installation with minimal output' ) do
|
55
55
|
options[:silent] = true
|
56
56
|
end #do
|
57
|
+
|
58
|
+
options[:version] = nil
|
59
|
+
opts.on( '-v', '--version VERSION', 'Specify VERSION as the rhoconect version' ) do |ver|
|
60
|
+
options[:version] = ver
|
61
|
+
end #do
|
57
62
|
|
58
|
-
options[:web_server] = "
|
59
|
-
opts.on( '-w', '--web-server SERVER', 'Specify apache2 or nginx. Default is
|
63
|
+
options[:web_server] = "nginx"
|
64
|
+
opts.on( '-w', '--web-server SERVER', 'Specify apache2 or nginx. Default is Nginx.' ) do |server|
|
60
65
|
options[:web_server] = server
|
61
66
|
end #do
|
62
67
|
|
@@ -69,7 +74,7 @@ end #do
|
|
69
74
|
options[:start_dir] = `pwd`.strip
|
70
75
|
|
71
76
|
optparse.parse!
|
72
|
-
log = Logger.new(IO.readlines("#{options[:prefix]}info.dat").last.strip)
|
77
|
+
log = Logger.new(IO.readlines("#{options[:prefix]}/info.dat").last.strip)
|
73
78
|
log.datetime_format = "%Y-%m-%d %H:%M:%S" # simplify time output
|
74
79
|
options[:log] = log
|
75
80
|
|