Commit 41b9f452 by Ned Batchelder Committed by GitHub

Merge pull request #3362 from edx/ned/no-install-subdir

Don't install into a subdirectory
parents 9b8cbe9e 66a25250
...@@ -118,6 +118,11 @@ else ...@@ -118,6 +118,11 @@ else
release=$OPENEDX_RELEASE release=$OPENEDX_RELEASE
fi fi
if [[ ! $release ]]; then
echo "You must specify RELEASE, or define OPENEDX_RELEASE before running."
exit 1
fi
# If there are positional arguments left, something is wrong. # If there are positional arguments left, something is wrong.
if [[ $1 ]]; then if [[ $1 ]]; then
echo "Don't understand extra arguments: $*" echo "Don't understand extra arguments: $*"
...@@ -125,8 +130,10 @@ if [[ $1 ]]; then ...@@ -125,8 +130,10 @@ if [[ $1 ]]; then
exit 1 exit 1
fi fi
exec > >(tee install-$(date +%Y%m%d-%H%M%S).log) 2>&1 mkdir -p logs
echo "Capturing output to install-$(date +%Y%m%d-%H%M%S).log." 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')" echo "Installation started at $(date '+%Y-%m-%d %H:%M:%S')"
export OPENEDX_RELEASE=$release export OPENEDX_RELEASE=$release
...@@ -138,32 +145,28 @@ if [[ $vagrant_mount_location != "" ]]; then ...@@ -138,32 +145,28 @@ if [[ $vagrant_mount_location != "" ]]; then
export VAGRANT_MOUNT_BASE=vagrant_mount_location export VAGRANT_MOUNT_BASE=vagrant_mount_location
fi fi
if [[ -d "$stack" ]]; then if [[ -d .vagrant ]]; then
echo -e "${ERROR}A $stack directory already exists here. If you already tried installing $stack, make sure to vagrant destroy the $stack machine and rm -rf the $stack directory before trying to reinstall. If you would like to install a separate $stack, change to a different directory and try running the script again.${NC}" echo -e "${ERROR}A .vagrant directory already exists here. If you already tried installing $stack, make sure to vagrant destroy the $stack machine and 'rm -rf .vagrant' before trying to reinstall. If you would like to install a separate $stack, change to a different directory and try running the script again.${NC}"
exit 1 exit 1
fi fi
if [[ $stack == "devstack" ]]; then # Install devstack if [[ $stack == "devstack" ]]; then # Install devstack
# Warn if release chosen is not master or open-release (Eucalyptus and up) # Warn if release chosen is not master or open-release (Eucalyptus and up)
if [[ $release != "master" && $release != *"open-release"* ]]; then if [[ $release != "master" && $release != "open-release"* ]]; then
echo -e "${WARN}The release you entered is not 'master' or an open-release. Please be aware that a branch other than master or a release other than the latest open-release could cause errors when installing $stack.${NC}" echo -e "${WARN}The release you entered is not 'master' or an open-release. Please be aware that a branch other than master or a release other than the latest open-release could cause errors when installing $stack.${NC}" | fmt
fi fi
wiki_link="https://openedx.atlassian.net/wiki/display/OpenOPS/Running+Devstack" wiki_link="https://openedx.atlassian.net/wiki/display/OpenOPS/Running+Devstack"
mkdir devstack curl -fOL# https://raw.githubusercontent.com/edx/configuration/${OPENEDX_RELEASE}/vagrant/release/devstack/Vagrantfile
cd devstack
curl -L https://raw.githubusercontent.com/edx/configuration/${OPENEDX_RELEASE}/vagrant/release/devstack/Vagrantfile > Vagrantfile
vagrant plugin install vagrant-vbguest vagrant plugin install vagrant-vbguest
elif [[ $stack == "fullstack" ]]; then # Install fullstack elif [[ $stack == "fullstack" ]]; then # Install fullstack
# Warn if release chosen is not open-release (Eucalyptus and up) # Warn if release chosen is not open-release (Eucalyptus and up)
if [[ $release != *"open-release"* ]]; then if [[ $release != "open-release"* ]]; then
echo -e "${WARN}The release you entered is not an open-release. Please be aware that a branch other than the latest open-release could cause errors when installing $stack.${NC}" echo -e "${WARN}The release you entered is not an open-release. Please be aware that a branch other than the latest open-release could cause errors when installing $stack.${NC}"
fi fi
wiki_link="https://openedx.atlassian.net/wiki/display/OpenOPS/Running+Fullstack" wiki_link="https://openedx.atlassian.net/wiki/display/OpenOPS/Running+Fullstack"
mkdir fullstack curl -fOL# https://raw.githubusercontent.com/edx/configuration/${OPENEDX_RELEASE}/vagrant/release/fullstack/Vagrantfile
cd fullstack
curl -L https://raw.githubusercontent.com/edx/configuration/${OPENEDX_RELEASE}/vagrant/release/fullstack/Vagrantfile > Vagrantfile
vagrant plugin install vagrant-hostsupdater vagrant plugin install vagrant-hostsupdater
else # Throw error else # Throw error
echo -e "${ERROR}Unrecognized stack name, must be either devstack or fullstack!${NC}" echo -e "${ERROR}Unrecognized stack name, must be either devstack or fullstack!${NC}"
...@@ -186,5 +189,5 @@ else ...@@ -186,5 +189,5 @@ else
fi fi
echo "Installation finished at $(date '+%Y-%m-%d %H:%M:%S')" echo "Installation finished at $(date '+%Y-%m-%d %H:%M:%S')"
echo -e "${SUCCESS}Finished installing! You may now 'cd $stack' and login using 'vagrant ssh'" echo -e "${SUCCESS}Finished installing! You may now log in using 'vagrant ssh'"
echo -e "Refer to the edX wiki ($wiki_link) for more information on using $stack.${NC}" echo -e "Refer to the edX wiki ($wiki_link) for more information on using $stack.${NC}"
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