Commit 7a95c374 by Xavier Antoviaque Committed by David Baumgold

Install: Options "-q" (quiet), "-n" (no pull), "-y" (non interactive)

Added several options to the `create-dev-env.sh` script to improve its
ability to be used by another script:

* -y -- non interactive mode (no prompt, proceed immediately)
* -n -- do not attempt to pull edx-platform
* -q -- be more quiet (removes info at beginning & end)

This will be used, in particular, for Vagrant provisioning.
parent ba8c2999
......@@ -49,8 +49,11 @@ usage() {
Usage: $PROG [-c] [-v] [-h]
-y non interactive mode (no prompt, proceed immediately)
-c compile scipy and numpy
-n do not attempt to pull edx-platform
-s give access to global site-packages for virtualenv
-q be more quiet (removes info at beginning & end)
-v set -x + spew
-h this
......@@ -78,10 +81,11 @@ change_git_push_defaults() {
clone_repos() {
change_git_push_defaults
cd "$BASE"
if [[ ! $nopull ]]; then
change_git_push_defaults
if [[ -d "$BASE/edx-platform/.git" ]]; then
output "Pulling edx platform"
cd "$BASE/edx-platform"
......@@ -94,6 +98,7 @@ clone_repos() {
fi
git clone https://github.com/edx/edx-platform.git
fi
fi
}
set_base_default() { # if PROJECT_HOME not set
......@@ -149,7 +154,7 @@ if [[ "x$VIRTUAL_ENV" != "x" ]]; then
fi
# Read arguments
ARGS=$(getopt "cvhs" "$*")
ARGS=$(getopt "cvhsynq" "$*")
if [[ $? != 0 ]]; then
usage
exit 1
......@@ -170,6 +175,18 @@ while true; do
verbose=true
shift
;;
-y)
noninteractive=true
shift
;;
-q)
quiet=true
shift
;;
-n)
nopull=true
shift
;;
-h)
usage
exit 0
......@@ -181,7 +198,8 @@ while true; do
esac
done
cat<<EO
if [[ ! $quiet ]]; then
cat<<EO
This script will setup a local edX environment, this
includes
......@@ -201,10 +219,13 @@ cat<<EO
shell.
EO
info
output "Press return to begin or control-C to abort"
read dummy
fi
info
if [[ ! $noninteractive ]]; then
output "Press return to begin or control-C to abort"
read dummy
fi
# Log all stdout and stderr
......@@ -225,6 +246,7 @@ case `uname -s` in
distro=`lsb_release -cs`
case $distro in
wheezy|jessie|maya|olivia|nadia|precise|quantal)
if [[ ! $noninteractive ]]; then
warning "
Debian support is not fully debugged. Assuming you have standard
development packages already working like scipy rvm, the
......@@ -236,8 +258,10 @@ case `uname -s` in
Press return to continue or control-C to abort"
read dummy
sudo apt-get install git ;;
fi
sudo apt-get install -yq git ;;
squeeze|lisa|katya|oneiric|natty|raring)
if [[ ! $noninteractive ]]; then
warning "
It seems like you're using $distro which has been deprecated.
While we don't technically support this release, the install
......@@ -248,7 +272,8 @@ case `uname -s` in
Press return to continue or control-C to abort"
read dummy
sudo apt-get install git
fi
sudo apt-get install -yq git
;;
*)
......@@ -529,7 +554,8 @@ git config --global push.default current
### DONE
cat<<END
if [[ ! $quiet ]]; then
cat<<END
Success!!
To start using Django you will need to activate the local Python
......@@ -567,4 +593,6 @@ cat<<END
END
fi
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