Commit b46b7daf by John Jarvis

added a posix compliant check to make sure you are using bash to run the script,…

added a posix compliant check to make sure you are using bash to run the script, added option to use --system-site-packages for virtualenv, updated the ending instructions on how to start the server
parent eb4272e3
#!/bin/bash #!/usr/bin/env bash
set -e set -e
# posix compliant sanity check
if [ -z $BASH ] || [ $BASH = "/bin/sh" ]; then
echo "Please use the bash interpreter to run this script"
exit 1
fi
trap "ouch" ERR trap "ouch" ERR
ouch() { ouch() {
...@@ -29,6 +36,7 @@ usage() { ...@@ -29,6 +36,7 @@ usage() {
Usage: $PROG [-c] [-v] [-h] Usage: $PROG [-c] [-v] [-h]
-c compile scipy and numpy -c compile scipy and numpy
-s --system-site-packages for virtualenv
-v set -x + spew -v set -x + spew
-h this -h this
...@@ -106,7 +114,7 @@ if [[ $EUID -eq 0 ]]; then ...@@ -106,7 +114,7 @@ if [[ $EUID -eq 0 ]]; then
usage usage
exit 1 exit 1
fi fi
ARGS=$(getopt "cvh" "$*") ARGS=$(getopt "cvhs" "$*")
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
usage usage
exit 1 exit 1
...@@ -118,6 +126,10 @@ while true; do ...@@ -118,6 +126,10 @@ while true; do
compile=true compile=true
shift shift
;; ;;
-s)
systempkgs=true
shift
;;
-v) -v)
set -x set -x
verbose=true verbose=true
...@@ -148,7 +160,7 @@ cat<<EO ...@@ -148,7 +160,7 @@ cat<<EO
To compile scipy and numpy from source use the -c option To compile scipy and numpy from source use the -c option
STDOUT is redirected to /var/tmp/install.log, run Most of STDOUT is redirected to /var/tmp/install.log, run
$ tail -f /var/tmp/install.log $ tail -f /var/tmp/install.log
to monitor progress to monitor progress
...@@ -238,7 +250,11 @@ curl -sL get.rvm.io | bash -s stable ...@@ -238,7 +250,11 @@ curl -sL get.rvm.io | bash -s stable
source $RUBY_DIR/scripts/rvm source $RUBY_DIR/scripts/rvm
# skip the intro # skip the intro
LESS="-E" rvm install $RUBY_VER LESS="-E" rvm install $RUBY_VER
virtualenv "$PYTHON_DIR" if [[ -n $systempkgs ]]; then
virtualenv --system-site-packages "$PYTHON_DIR"
else
virtualenv "$PYTHON_DIR"
fi
source $PYTHON_DIR/bin/activate source $PYTHON_DIR/bin/activate
output "Installing gem bundler" output "Installing gem bundler"
gem install bundler gem install bundler
...@@ -277,23 +293,38 @@ mkdir "$BASE/log" || true ...@@ -277,23 +293,38 @@ mkdir "$BASE/log" || true
mkdir "$BASE/db" || true mkdir "$BASE/db" || true
cat<<END cat<<END
Success!! Success!!
To start using Django you will need To start using Django you will need to activate the local Python
to activate the local Python and Ruby and Ruby environment (at this time rvm only supports bash) :
environment:
$ source $RUBY_DIR/scripts/rvm $ source $RUBY_DIR/scripts/rvm
$ source $PYTHON_DIR/bin/activate $ source $PYTHON_DIR/bin/activate
To initialize and start a local instance of Django: To initialize Django
$ cd $BASE/mitx $ cd $BASE/mitx
$ django-admin.py syncdb --settings=envs.dev --pythonpath=. $ rake django-admin[syncdb]
$ django-admin.py migrate --settings=envs.dev --pythonpath=. $ rake django-admin[migrate]
$ django-admin.py runserver --settings=envs.dev --pythonpath=.
To start the Django on port 8000
$ rake lms
Or to start Django on a different <port#>
$ rake django-admin[runserver,lms,dev,<port#>]
If the Django development server starts properly you
should see:
Development server is running at http://127.0.0.1:<port#>/
Quit the server with CONTROL-C.
Connect your browser to http://127.0.0.1:<port#> to
view the Django site.
END END
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment