diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/genenetwork2 | 32 | ||||
-rwxr-xr-x | bin/test-website | 23 |
2 files changed, 42 insertions, 13 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2 index d3bf3299..d926d6a1 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -1,24 +1,36 @@ #! /bin/bash # -# This will run the GN2 server (with default settings if none supplied). +# This will run the GN2 server (with default settings if none supplied). Pass in +# your own settings file, e.g. +# +# ./bin/genenetwork2 ~/my_settings.py +# +# To run a maintenance script with settings (instead of the webserver) add that with +# a -c switch, e.g. +# +# ./bin/genenetwork2 ~/my_settings.py -c ./wqflask/maintenance/gen_select_dataset.py # # Environment settings can be used to preconfigure as well as a # settings.py file. -# Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=$(readlink -f "$0") -# Absolute path this script is in, thus /home/user/bin GN2_BASE_PATH=$(dirname $(dirname "$SCRIPT")) GN2_GUIX_PATH=$GN2_BASE_PATH/lib/python2.7/site-packages/genenetwork2-2.0-py2.7.egg if [ -d $GN2_GUIX_PATH ]; then + echo GN2 is running from GUIX GN2_BASE_PATH=$GN2_GUIX_PATH fi echo $GN2_BASE_PATH # Handle settings parameter settings=$1 -if [ -z $settings ]; then settings=$GN2_BASE_PATH/etc/default_settings.py ; fi +if [ -z $settings ]; then + # get default + settings=$GN2_BASE_PATH/etc/default_settings.py +else + shift +fi if [ ! -e $settings ]; then echo "ERROR: can not locate settings file - pass it in the command line" exit 1 @@ -32,7 +44,17 @@ export PYTHONPATH=$GN2_BASE_PATH/wqflask:$PYTHONPATH if [ -z $TEMPDIR ]; then TEMPDIR="/tmp" fi - + +# Now handle command parameter -c +if [ $1 = '-c' ] ; then + cd $GN2_BASE_PATH/wqflask + cmd=${2#wqflask/} + echo PYTHONPATH=$PYTHONPATH + echo RUNNING COMMAND $cmd + /usr/bin/env python $cmd + exit 0 +fi + echo "Starting the redis server:" echo -n "dir $TEMPDIR dbfilename gn2.rdb diff --git a/bin/test-website b/bin/test-website index 2e91f364..18994cc5 100755 --- a/bin/test-website +++ b/bin/test-website @@ -2,8 +2,8 @@ USAGE = <<EOT -This is Mechanical-Rob - an automated web server tester for - Genenetwork.org that uses the brilliant +This is Mechanical-Rob - an automated web server tester for + Genenetwork.org that uses the brilliant mechanize gem. To use this software you need to install mechanize. Run it from @@ -16,7 +16,7 @@ If you are using the small deployment database you can use ./bin/test-website --skip -n For more information see http://genenetwork.org/ - + EOT $stderr.print USAGE @@ -25,7 +25,7 @@ require 'optparse' options = { database: :small, link_checker: false} opts = OptionParser.new do |o| o.banner = "Usage: #{File.basename($0)} [options] URL" - + o.on('-d','--database', String, 'Use database (default db_webqtl_s)') do |s| options[:database] = case s @@ -39,11 +39,15 @@ opts = OptionParser.new do |o| o.on('-l','--link-checker', 'Check for dead links') do options[:link_checker] = true end - - o.on('-n','--navigation-test', 'Check for navigation test results') do + + o.on('--navigation-test', 'Check for navigation') do options[:navigation_test] = true end + o.on('--mapping-test', 'Check for mapping') do + options[:mapping_test] = true + end + o.on('--skip-broken', 'Skip tests that are known to be broken') do options[:skip_broken] = true end @@ -62,7 +66,7 @@ if options[:show_help] end $options = options # we are using a global here -$host = +$host = if ARGV.size>0 ARGV.shift else @@ -85,8 +89,11 @@ if options[:link_checker] else require 'main_web_functionality' end - + if options[:navigation_test] require 'navigation' end +if options[:mapping_test] + require 'mapping' +end |