Commit 0c4e94c2 by Ned Batchelder

Log the session, and check the success

parent 3fed8dd3
#!/bin/bash
##
## Installs the pre-requisites for running edX on a single Ubuntu 16.04
## Installs the pre-requisites for running Open edX on a single Ubuntu 16.04
## instance. This script is provided as a convenience and any of these
## steps could be executed manually.
##
......@@ -23,6 +23,23 @@ if [[ `lsb_release -rs` != "16.04" ]]; then
fi
##
## Log what's happening
##
mkdir -p logs
log_file=logs/install-$(date +%Y%m%d-%H%M%S).log
exec > >(tee $log_file) 2>&1
echo "Capturing output to $log_file"
echo "Installation started at $(date '+%Y-%m-%d %H:%M:%S')"
function finish {
echo "Installation finished at $(date '+%Y-%m-%d %H:%M:%S')"
}
trap finish EXIT
echo "Installing release '$OPENEDX_RELEASE'"
##
## Set ppa repository source for gcc/g++ 4.8 in order to install insights properly
##
sudo apt-get install -y python-software-properties
......@@ -77,7 +94,7 @@ if [[ -f my-passwords.yml ]]; then
EXTRA_VARS="-e@$(pwd)/my-passwords.yml $EXTRA_VARS"
fi
CONFIGURATION_VERSION=${CONFIGURATION_VERSION-${OPENEDX_RELEASE-master}}
CONFIGURATION_VERSION=${CONFIGURATION_VERSION-$OPENEDX_RELEASE}
##
## Clone the configuration repository and run Ansible
......@@ -98,3 +115,18 @@ sudo -H pip install -r requirements.txt
## Run the edx_sandbox.yml playbook in the configuration/playbooks directory
##
cd /var/tmp/configuration/playbooks && sudo -E ansible-playbook -c local ./edx_sandbox.yml -i "localhost," $EXTRA_VARS "$@"
ansible_status=$?
if [[ $ansible_status -ne 0 ]]; then
echo " "
echo "========================================"
echo "Ansible failed!"
echo "----------------------------------------"
echo "If you need help, see https://open.edx.org/getting-help ."
echo "When asking for help, please provide as much information as you can."
echo "These might be helpful:"
echo " Your log file is at $log_file"
echo " Your environment:"
env | egrep -i 'version|release' | sed -e 's/^/ /'
echo "========================================"
fi
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