diff options
author | davor <vorgrimmlerdavid@gmx.de> | 2012-08-23 13:25:45 +0200 |
---|---|---|
committer | davor <vorgrimmlerdavid@gmx.de> | 2012-08-23 13:25:45 +0200 |
commit | d233a30f97254b9df75bbb63637e2bde9ba84a8c (patch) | |
tree | 45fb754f8c3b40acd485124a30666249dd4d2363 | |
parent | 0642f95461e7edf9cde575db67d63f74b528ce84 (diff) | |
parent | 492126c5c36d7861635793abd5c36936b5247659 (diff) |
Merge branch 'migration' into development
-rwxr-xr-x | bin/opentox-server-install | 50 | ||||
-rw-r--r-- | lib/opentox.rb | 1 |
2 files changed, 51 insertions, 0 deletions
diff --git a/bin/opentox-server-install b/bin/opentox-server-install new file mode 100755 index 0000000..c4701c3 --- /dev/null +++ b/bin/opentox-server-install @@ -0,0 +1,50 @@ +#!/bin/sh + +# Installs Opentox Webservice. +# Author: Christoph Helma, Andreas Maunz. + +SELF=$(basename $0 -install) +[ "`id -u`" = "0" ] && echo "This script must be run as non-root." 1>&2 && exit 1 + +# Adjust ruby version here! +RUBY_NUM_VER="1.9.3-p194" + +echo +echo "Welcome to service installation (<Return> to continue)." +read delete_me + + +# check wd is root of service +DIR=`pwd` +if echo $DIR | grep "$SELF/bin" >/dev/null 2>&1 ; then cd ..; fi + +# # # Boot the script + +# load base config, helper funs, environment +OT_CONFIG_DIR="$HOME/.opentox" +! [ -f "$OT_CONFIG_DIR/config/install/config.sh" ] && echo "config.sh not found." 1>&2 && exit 1 || . $OT_CONFIG_DIR/config/install/config.sh +! [ -f "$OT_PREFIX/install/utils.sh" ] && echo "utils.sh not found." 1>&2 && exit 1 || . $OT_PREFIX/install/utils.sh +[ -f $OT_CONFIG_DIR/opentox-ui.sh ] && . $OT_CONFIG_DIR/opentox-ui.sh # should have been done by user already +RUBY_DIR="$HOME/.rbenv/versions/$RUBY_NUM_VER" + + +# # # Install + +check_utils "rbenv find" +check_log $SELF + +if [ "$OT_BRANCH" = "development" ]; then + cmd="test -d $OT_PREFIX/opentox-client" && run_cmd "$cmd" "Opentox-client" +fi + +# ruby +install_ruby + +# self +echo +install_with_bundler + +notify + +# return to wd +cd "$DIR" diff --git a/lib/opentox.rb b/lib/opentox.rb index 1e7b791..3fb0088 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -1,6 +1,7 @@ require 'sinatra/base' require "sinatra/reloader" ENV["RACK_ENV"] ||= "production" +require File.join(ENV["HOME"],".opentox","config","default.rb") if File.exist? File.join(ENV["HOME"],".opentox","config","default.rb") require File.join(ENV["HOME"],".opentox","config","#{SERVICE}.rb") |