rhoconnect 3.0.0.beta3 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +40 -44
- data/doc/client.txt +16 -0
- data/doc/install.txt +2 -2
- data/examples/simple/dump.rdb +0 -0
- data/install.sh +49 -57
- data/installer/unix-like/post_install.sh +4 -0
- data/installer/unix-like/post_uninstall.sh +9 -0
- data/installer/unix-like/pre_install.sh +9 -0
- data/installer/unix-like/pre_uninstall.sh +23 -0
- data/installer/unix-like/rho_connect_install_checkers.rb +1 -4
- data/installer/unix-like/rho_connect_install_constants.rb +1 -1
- data/installer/unix-like/rho_connect_install_debian.rb +2 -2
- data/installer/unix-like/rho_connect_install_dnd.rb +7 -9
- data/installer/unix-like/rho_connect_install_get_params.rb +0 -2
- data/installer/unix-like/rho_connect_install_installers.rb +37 -37
- data/installer/unix-like/rho_connect_install_utilities.rb +7 -41
- data/installer/unix-like/rhoinstaller.rb +1 -5
- data/installer/utils/create_texts.rb +26 -9
- data/installer/utils/install_test.rb +24 -12
- data/installer/windows/rhosync.nsi +5 -5
- data/lib/rhoconnect/console/app/public/home.css +3 -10
- data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
- data/lib/rhoconnect/console/app/routes/docs.rb +1 -1
- data/lib/rhoconnect/console/app/routes/home.rb +1 -1
- data/lib/rhoconnect/console/app/routes/user.rb +1 -1
- data/lib/rhoconnect/console/app/views/index.erb +1 -1
- data/lib/rhoconnect/console/app/views/layout.erb +4 -16
- data/lib/rhoconnect/db_adapter.rb +5 -7
- data/lib/rhoconnect/tasks.rb +31 -4
- data/lib/rhoconnect/version.rb +1 -1
- data/tasks/redis.rake +2 -2
- metadata +10 -21
- data/bin/rhoconnect-setup +0 -84
- data/installer/deb-scripts/LICENSE +0 -75
- data/installer/deb-scripts/install.sh +0 -300
- data/installer/deb-scripts/scripts/rho_connect_install_constants.rb +0 -32
- data/installer/deb-scripts/scripts/rho_connect_install_installers.rb +0 -103
- data/installer/deb-scripts/scripts/rho_connect_install_utilities.rb +0 -110
- data/installer/deb-scripts/scripts/rhoinstaller.rb +0 -55
- data/installer/deb-scripts/utils/README +0 -67
- data/installer/deb-scripts/utils/create_texts.rb +0 -76
- data/installer/deb-scripts/utils/redis_init_script +0 -124
- data/installer/deb-scripts/utils/redis_log_rotate +0 -8
- data/installer/unix-like/install.sh +0 -361
- data/installer/unix-like/post-install.sh +0 -8
- data/installer/unix-like/pre-install.sh +0 -8
- data/lib/rhoconnect/console/app/public/images/rhomobile_rhohub_logo.png +0 -0
@@ -1,361 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
# DO FIRST
|
4
|
-
|
5
|
-
# make sure only run as root
|
6
|
-
if [ "$(id -u)" != "0" ]; then
|
7
|
-
echo "This script must be run as root"
|
8
|
-
exit 1
|
9
|
-
fi
|
10
|
-
|
11
|
-
timeInitial=`date +%H%M%S`
|
12
|
-
installTime=$timeInitial
|
13
|
-
|
14
|
-
# CONSTANTS
|
15
|
-
|
16
|
-
RHOCONNECT_VERSION="3.0.0.beta3"
|
17
|
-
PACKAGE_INSTALL_DIR="/tmp/installdir/rhoconnect-${RHOCONNECT_VERSION}"
|
18
|
-
DEPS=(gcc tar make wget)
|
19
|
-
|
20
|
-
# FUNCTIONS
|
21
|
-
|
22
|
-
echoLog ()
|
23
|
-
{
|
24
|
-
timeStamp="[`date`]: "
|
25
|
-
echo -e $1
|
26
|
-
#end echoLog
|
27
|
-
}
|
28
|
-
|
29
|
-
showHelp ()
|
30
|
-
{
|
31
|
-
echoLog "
|
32
|
-
Usage: install.sh [options]\n
|
33
|
-
--no-redis Skip the installation of the redis server.\n
|
34
|
-
--offline Check that all necessary files are installed in /opt/rhoconnect if no prefix is specified.\n
|
35
|
-
-p, --prefix PREFIX Specify PREFIX as the installation directory. Default is /opt/rhoconnect.\n
|
36
|
-
-r, --ruby-version VERSION Specify version of ruby to install. Default is Ruby Enterprise.\n
|
37
|
-
-s, --silent Perform installation with minimal output.\n
|
38
|
-
--skip-ruby Use system ruby instead of ruby installed through this installer.\n
|
39
|
-
-w, --web-server SERVER Specify that you are using web server SERVER. Default is Nginx.\n
|
40
|
-
-h, --help Display this screen.\n
|
41
|
-
"
|
42
|
-
# End script after printing help message
|
43
|
-
exit
|
44
|
-
} #end showHelp
|
45
|
-
|
46
|
-
checkDeps ()
|
47
|
-
{
|
48
|
-
missingDeps=""
|
49
|
-
for ((i=0; i<${#DEPS[@]}; i++))
|
50
|
-
do
|
51
|
-
dep=`which ${DEPS[$i]} 2> /dev/null`
|
52
|
-
if [[ $dep == "" ]]; then
|
53
|
-
missingDeps="${missingDeps}${DEPS[$i]}\n"
|
54
|
-
fi
|
55
|
-
done
|
56
|
-
|
57
|
-
if [[ $missingDeps != "" ]]; then
|
58
|
-
echoLog "Dependencies Missing: " | tee -a $log
|
59
|
-
echoLog "${missingDeps}" | tee -a $log
|
60
|
-
echoLog "These must be installed before setup can continue..." | tee -a $log
|
61
|
-
exit
|
62
|
-
fi
|
63
|
-
} #end checkDeps
|
64
|
-
|
65
|
-
determinePkgMgr ()
|
66
|
-
{
|
67
|
-
if [[ `which apt-get 2> /dev/null` != "" ]]; then
|
68
|
-
pkgMgr="apt-get -y"
|
69
|
-
dist='debian'
|
70
|
-
elif [[ `which yum 2> /dev/null` != "" ]]; then
|
71
|
-
pkgMgr="yum -y"
|
72
|
-
dist='yum'
|
73
|
-
else
|
74
|
-
echoLog "No supported package manager." | tee -a $log
|
75
|
-
echoLog "Please install apt-get or yum to continue..." | tee -a $log
|
76
|
-
exit
|
77
|
-
fi
|
78
|
-
} #end determinePkgMgr
|
79
|
-
|
80
|
-
parseOpts ()
|
81
|
-
{
|
82
|
-
for i in "$*"; do
|
83
|
-
i=$(echo $i | tr '[:upper:]' '[:lower:]')
|
84
|
-
opts="${opts}${i} "
|
85
|
-
# looking for getVal flag to grab next value.
|
86
|
-
case $getVal in
|
87
|
-
"p" )
|
88
|
-
prefix=$i
|
89
|
-
;;
|
90
|
-
"w" )
|
91
|
-
webServer=$i
|
92
|
-
;;
|
93
|
-
"r" )
|
94
|
-
rubyVersion=$i
|
95
|
-
;;
|
96
|
-
* )
|
97
|
-
;;
|
98
|
-
esac
|
99
|
-
|
100
|
-
# Check options passed in and assign flags where applicable
|
101
|
-
case $i in
|
102
|
-
--web-server | -w )
|
103
|
-
getVal="w"
|
104
|
-
;;
|
105
|
-
--prefix | -p )
|
106
|
-
getVal="p"
|
107
|
-
;;
|
108
|
-
--ruby-version )
|
109
|
-
getVal="r"
|
110
|
-
;;
|
111
|
-
--offline )
|
112
|
-
;;
|
113
|
-
--silent | -s )
|
114
|
-
;;
|
115
|
-
--skip-redis )
|
116
|
-
redis=false
|
117
|
-
;;
|
118
|
-
--skip-ruby )
|
119
|
-
ruby=false
|
120
|
-
;;
|
121
|
-
--help | -h )
|
122
|
-
showHelp
|
123
|
-
;;
|
124
|
-
* )
|
125
|
-
if [ "${i}" ]; then
|
126
|
-
echoLog "${i} is not a valid option" | tee -a $log
|
127
|
-
exit
|
128
|
-
fi
|
129
|
-
;;
|
130
|
-
esac
|
131
|
-
done
|
132
|
-
} #end parseOpts
|
133
|
-
|
134
|
-
cleanPrefix ()
|
135
|
-
{
|
136
|
-
# make sure there are no double /'s in the prefix path
|
137
|
-
prefix=${prefix/\/\/+/"/"}
|
138
|
-
|
139
|
-
# make sure path is absolute for ruby EE installation
|
140
|
-
if [[ $prefix == *\.* ]]; then
|
141
|
-
prefix=${prefix/\./`pwd`}
|
142
|
-
fi
|
143
|
-
|
144
|
-
# make sure prefix exists, create if not
|
145
|
-
if ! [ -d $prefix ]; then
|
146
|
-
mkdir -p $prefix
|
147
|
-
fi
|
148
|
-
} #end cleanPrefix
|
149
|
-
|
150
|
-
setPrefixDependantPaths ()
|
151
|
-
{
|
152
|
-
# if rubyBinDir not specified
|
153
|
-
if [$rubyBinDir == ""]; then
|
154
|
-
rubyBinDir="${prefix}/ruby/bin"
|
155
|
-
fi
|
156
|
-
|
157
|
-
# If logs directory does not exist, create it
|
158
|
-
if ! [[ -d "${prefix}/logs/" ]]; then
|
159
|
-
mkdir "${prefix}/logs/"
|
160
|
-
fi
|
161
|
-
|
162
|
-
# Make path to log file absolute and create directory if not already existent
|
163
|
-
log="${prefix}/logs/${log}"
|
164
|
-
touch $log
|
165
|
-
|
166
|
-
# Add the log file path to the info file
|
167
|
-
`echo $log >> info.dat`
|
168
|
-
cat info.dat
|
169
|
-
|
170
|
-
# Move info.dat into installation directory if not already there
|
171
|
-
if ! [ -e "${prefix}/info.dat" ]; then
|
172
|
-
mv info.dat "${prefix}/info.dat"
|
173
|
-
fi
|
174
|
-
} #end setPrefixDependantPaths
|
175
|
-
|
176
|
-
setDefaults ()
|
177
|
-
{
|
178
|
-
# if $prefix not specified set to /opt/rhoconnect
|
179
|
-
if [$prefix == ""]; then
|
180
|
-
prefix="/opt/rhoconnect"
|
181
|
-
fi
|
182
|
-
|
183
|
-
# if $webServer not specified set to nginx
|
184
|
-
if [$webServer == ""]; then
|
185
|
-
webServer="nginx"
|
186
|
-
fi
|
187
|
-
} #end setDefaults
|
188
|
-
|
189
|
-
logAndPrint ()
|
190
|
-
{
|
191
|
-
$1 > tempout 2>&1
|
192
|
-
exitStatus=$?
|
193
|
-
cat tempout | tee -a $log
|
194
|
-
} #end logAndPrint
|
195
|
-
|
196
|
-
setRubyVars ()
|
197
|
-
{
|
198
|
-
if [[ $rubyVersion == "" || $rubyVersion =~ ruby'ee'|'enterprise' ]]; then
|
199
|
-
rubyVersion="rubyee"
|
200
|
-
rubyDir="ruby-enterprise-1.8.7-2011.03"
|
201
|
-
rubyTar="${rubyDir}.tar.gz"
|
202
|
-
rubyURL="http://rubyenterpriseedition.googlecode.com/files/${rubyTar}"
|
203
|
-
elif [$rubyVersion == "ruby187"]; then
|
204
|
-
rubyDir="ruby-1.8.7"
|
205
|
-
rubyTar="${rubyDir}.tar.gz"
|
206
|
-
rubyURL="ftp://ftp.ruby-lang.org/pub/ruby/1.8/${rubyTar}"
|
207
|
-
elif [$rubyVersion == "ruby192"]; then
|
208
|
-
rubyDir="ruby-1.9.2-p180"
|
209
|
-
rubyTar="${rubyDir}.tar.gz"
|
210
|
-
rubyURL="http://ftp.ruby-lang.org/pub/ruby/1.9/${rubyTar}"
|
211
|
-
else
|
212
|
-
echoLog "${rubyVersion} is not a valid ruby version" | tee -a $log
|
213
|
-
exit
|
214
|
-
fi
|
215
|
-
} #end setRubyVars
|
216
|
-
|
217
|
-
installRuby ()
|
218
|
-
{
|
219
|
-
if [[ ! -d "${prefix}${rubyDir}" ]]; then
|
220
|
-
echoLog "Loading ruby tarball ..." | tee -a $log
|
221
|
-
echoLog "wget -P ${prefix} ${rubyURL}" | tee -a $log
|
222
|
-
wget -P ${prefix} ${rubyURL}
|
223
|
-
echoLog "tar -xzf ${prefix}/${rubyTar} -C ${prefix}" | tee -a $log
|
224
|
-
tar -xzf ${prefix}/${rubyTar} -C ${prefix}
|
225
|
-
fi
|
226
|
-
echoLog "Installing ruby. This may take some time..." | tee -a $log
|
227
|
-
|
228
|
-
case $rubyVersion in
|
229
|
-
rubyee)
|
230
|
-
logAndPrint "${prefix}/${rubyDir}/installer --dont-install-useful-gems --no-dev-docs --auto ${prefix}"
|
231
|
-
;;
|
232
|
-
ruby187)
|
233
|
-
logAndPrint "${prefix}/${rubyDir}/configure --prefix=\"${prefix}\""
|
234
|
-
logAndPrint "make && make install"
|
235
|
-
;;
|
236
|
-
ruby192)
|
237
|
-
logAndPrint "${prefix}/${rubyDir}/configure --prefix=\"${prefix}\""
|
238
|
-
logAndPrint "make && make install"
|
239
|
-
;;
|
240
|
-
*)
|
241
|
-
logAndPrint "echoLog \"${rubyVersion} is not a supported ruby version\""
|
242
|
-
exit
|
243
|
-
;;
|
244
|
-
esac
|
245
|
-
|
246
|
-
if [[ $exitStatus != 0 ]]; then
|
247
|
-
echoLog "Some dependencies not installed..." | tee -a $log
|
248
|
-
echoLog "Please install them and then re-run the installation script." | tee -a $log
|
249
|
-
exit
|
250
|
-
fi
|
251
|
-
|
252
|
-
rm tempout
|
253
|
-
} #end installRuby
|
254
|
-
|
255
|
-
getTime ()
|
256
|
-
{
|
257
|
-
timeDiff=$(( $1 - $timeInitial ))
|
258
|
-
timeSec=$(( $timeDiff % 100 ))
|
259
|
-
timeDiff=$(( $timeDiff / 100 ))
|
260
|
-
|
261
|
-
if [ $timeSec -gt 1 ]; then
|
262
|
-
timeSec=$timeSec" seconds"
|
263
|
-
else
|
264
|
-
timeSec=$timeSec" second"
|
265
|
-
fi
|
266
|
-
|
267
|
-
if [ $timeDiff -gt 0 ]; then
|
268
|
-
timeMin=$(( $timeDiff % 100 ))
|
269
|
-
timeDiff=$(( $timeDiff / 100 ))
|
270
|
-
if [ $timeMin -gt 1 ]; then
|
271
|
-
timeMin=$timeMin" minutes and "
|
272
|
-
else
|
273
|
-
timeMin=$timeMin" minute and "
|
274
|
-
fi
|
275
|
-
fi
|
276
|
-
|
277
|
-
if [ $timeDiff -gt 0 ]; then
|
278
|
-
timeHour=$(( $timeDiff % 100 ))
|
279
|
-
timeDiff=$(( $timeDiff / 100 ))
|
280
|
-
if [ $timeHour -gt 1 ]; then
|
281
|
-
timeHour=$timeHour" hours, "
|
282
|
-
else
|
283
|
-
timeHour=$timeHour" hour, "
|
284
|
-
fi
|
285
|
-
fi
|
286
|
-
|
287
|
-
echoLog "\nInstallation completed in ${timeHour}${timeMin}${timeSec}."
|
288
|
-
} #end getTime
|
289
|
-
|
290
|
-
# SCRIPT
|
291
|
-
# define log file name
|
292
|
-
DATEFILE=`date +%Y%m%d%H%M%S`
|
293
|
-
log=rhoconnect_$(date +$DATEFILE).log
|
294
|
-
|
295
|
-
# Make sure basic system dependencies are installed
|
296
|
-
checkDeps
|
297
|
-
|
298
|
-
# Determine which package management the system uses (Debian short-circuted)
|
299
|
-
determinePkgMgr
|
300
|
-
|
301
|
-
# define option variables
|
302
|
-
opts=""
|
303
|
-
prefix=""
|
304
|
-
getVal=""
|
305
|
-
webServer=""
|
306
|
-
rubyVersion=""
|
307
|
-
rubyBinDir=""
|
308
|
-
|
309
|
-
# parse command-line options
|
310
|
-
parseOpts "$*"
|
311
|
-
|
312
|
-
# Set default Values
|
313
|
-
setDefaults
|
314
|
-
|
315
|
-
# Reformat ruby version to fit this scripts format
|
316
|
-
# Tolower rubyVersion
|
317
|
-
rubyVersion=$(echoLog $rubyVersion | tr '[:upper:]' '[:lower:]')
|
318
|
-
# Remove all white space
|
319
|
-
rubyVersion=${rubyVersion//[[:space:]]}
|
320
|
-
# Remove periods and hyphens such as those present in version numbers
|
321
|
-
rubyVersion=${rubyVersion//[-.]/}
|
322
|
-
|
323
|
-
# Set ruby insatallation variables
|
324
|
-
setRubyVars
|
325
|
-
|
326
|
-
# Clean up the formatting of prefix
|
327
|
-
cleanPrefix
|
328
|
-
|
329
|
-
# Once the prefix path is cleaned up...
|
330
|
-
setPrefixDependantPaths
|
331
|
-
|
332
|
-
# Install ruby if not already installed
|
333
|
-
if ! [ -e "${prefix}/bin/ruby" ]; then
|
334
|
-
installRuby
|
335
|
-
else
|
336
|
-
echoLog "Ruby already installed" | tee -a $log
|
337
|
-
fi
|
338
|
-
|
339
|
-
# Construct the string with which to call the ruby installation script.
|
340
|
-
callruby="sudo ${prefix}/bin/ruby ${PACKAGE_INSTALL_DIR}/unix-like/rhoinstaller.rb ${opts}"
|
341
|
-
# Call the ruby script
|
342
|
-
$callruby
|
343
|
-
|
344
|
-
if [[ $installedSoftware -eq ${#INSTALL_ARRAY[@]} ]]; then
|
345
|
-
rm "${prefix}/info.dat"
|
346
|
-
if [ -e $prefix$rubyTar ]; then
|
347
|
-
mv $prefix/$rubyTar $prefix"/downloads/"$rubyTar
|
348
|
-
fi
|
349
|
-
if [ -e $prefix$rubyDir ]; then
|
350
|
-
mv $prefix$rubyDir $prefix"/downloads/"$rubyDir
|
351
|
-
fi
|
352
|
-
if [ ! -e $prefix"/post-install" ]; then
|
353
|
-
mkdir $prefix"/post-install"
|
354
|
-
fi
|
355
|
-
|
356
|
-
opts=$opts" -d $dist"
|
357
|
-
|
358
|
-
sudo ${prefix}/bin/ruby ${PACKAGE_INSTALL_DIR}/utils/create_texts.rb ${opts}
|
359
|
-
# timeFinal=`date +%H%M%S`
|
360
|
-
# getTime $timeFinal
|
361
|
-
fi
|
Binary file
|