summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2012-09-10 13:45:45 +0400
committergebele <gebele@in-silico.ch>2012-09-10 13:45:45 +0400
commit1aee5060597078cb5d011fbec858044425956484 (patch)
tree5562bee15016b9da2fe5d3afa03dce3796bbc4e2
parenta40d23c08b45d2c53450cf5146d096c759b5218d (diff)
parent68b616f0a3609c38e91dce2c726ae3b56376e40e (diff)
Merge branch 'development' of github.com:/opentox/opentox-server into development
-rw-r--r--VERSION2
-rwxr-xr-xbin/opentox-server-install50
-rw-r--r--lib/opentox.rb1
3 files changed, 52 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 8c5ba87..274edc4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.0pre1
+1.0.0pre1
diff --git a/bin/opentox-server-install b/bin/opentox-server-install
new file mode 100755
index 0000000..e832cd4
--- /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
+
+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
+
+# Adjust ruby version here!
+RUBY_NUM_VER="1.9.3-p194"
+
+# 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")