Commit 4ec5882d by Ned Batchelder Committed by GitHub

Merge pull request #3337 from edx/ned/install-sh-improvements

Improvements to install_stack.sh
parents 386d5410 b8b8728e
#!/usr/bin/env bash
# Stop if any command fails
# Setting OPENEDX_DEBUG makes this more verbose.
if [[ $OPENEDX_DEBUG ]]; then
set -x
fi
# Stop if any command fails.
set -e
function usage
......@@ -11,47 +16,51 @@ function usage
Usage: $ bash install_stack.sh stack release [-b vagrant_mount_base] [-v] [-h]
Installs the Open edX devstack or fullstack. If you encounter any trouble or have
questions regarding installation of devstack/fullstack, head over to
https://open.edx.org/getting-help.
Installs the Open edX devstack or fullstack. If you encounter any trouble
or have questions, head over to https://open.edx.org/getting-help.
This script captures a log of all output produced during runtime, and saves it in a .log
file within the current directory. If you encounter an error during installation, this is
an invaluable tool for edX developers to help discover what went wrong, so please share it
if you reach out for support!
This script captures a log of all output produced during runtime, and saves
it in a .log file within the current directory. If you encounter an error
during installation, this is an invaluable tool for edX developers to help
discover what went wrong, so please share it if you reach out for support!
NOTE: This script assumes you have never installed devstack before. Installing multiple
versions of devstack can often cause conflicts that this script is not prepared to handle.
NOTE: This script assumes you have never installed devstack before.
Installing multiple versions of devstack can often cause conflicts that
this script is not prepared to handle.
stack
Either 'fullstack' or 'devstack' (no quotes). Full stack mimics a production
environment, whereas devstack is useful if you plan on modifying the Open edX
code. You must specify this. If you choose fullstack, 'release' should be the
latest open-release. If you choose devstack, 'release' should be the latest
open-release or master.
Either 'fullstack' or 'devstack'. Fullstack mimics a production
environment, whereas devstack is useful if you plan on modifying the
Open edX code. You must specify this.
If you choose fullstack, 'release' should be the latest Open edX
release.
If you choose devstack, 'release' should be the latest Open edX
release or master.
release
The release of Open edX you wish to run. Install the given git ref 'release'.
You must specify this. Named releases are called "open-release/eucalyptus",
"open-release/eucalyptus.2", and so on. We recommend the latest stable open
release for general members of the open source community. Named releases can
be found at: https://openedx.atlassian.net/wiki/display/DOC/Open+edX+Releases.
If you plan on modifying the code, we recommend the "master" branch.
The release of Open edX you wish to run. Install the given git ref
'release'. You must specify this. Open edX releases are called
"open-release/eucalyptus.1", "open-release/eucalyptus.2", and so on.
We recommend the latest stable open release for general members of the
open source community. Details on available open releases can be found
at: https://openedx.atlassian.net/wiki/display/DOC/Open+edX+Releases.
If you plan on modifying the code, we recommend the "master" branch.
-b vagrant_mount_base
Customize the location of the source code that gets cloned during the
devstack provisioning. The default is the current directory. This option is
not valid if installing fullstack.
Customize the location of the source code that gets cloned during the
devstack provisioning. The default is the current directory. This
option is not valid if installing fullstack.
-v
-v
Verbose output from ansible playbooks.
-h
Show this help and exit.
---------------------------
EOM
}
......@@ -69,8 +78,8 @@ release=""
vagrant_mount_location=""
if [[ $# -lt 2 || ${1:0:1} == '-' || ${2:0:1} == '-' ]]; then
usage
exit 1
usage
exit 1
fi
stack=$1
......@@ -106,6 +115,7 @@ exec > >(tee install-$(date +%Y%m%d-%H%M%S).log) 2>&1
echo "Capturing output to install-$(date +%Y%m%d-%H%M%S).log."
export OPENEDX_RELEASE=$release
echo "Installing release '$OPENEDX_RELEASE'"
# Check if mount location was changed
if [[ $vagrant_mount_location != "" ]]; then
......@@ -152,7 +162,7 @@ fi
vagrant up --provider virtualbox
# Check if preview mode was chosen
# Set preview host.
if grep -q '192.168.33.10 preview.localhost' /etc/hosts; then
echo "Studio preview already enabled, skipping..."
else
......
#!/usr/bin/env bash
# Stop if any command fails
# Setting OPENEDX_DEBUG makes this more verbose.
if [[ $OPENEDX_DEBUG ]]; then
set -x
fi
# Stop if any command fails.
set -e
# Logging: write all the output to a timestamped log file.
......
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