Skip to content

Instantly share code, notes, and snippets.

@mralexjuarez
Last active June 25, 2019 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mralexjuarez/ba01190893220da211db80f45ccca247 to your computer and use it in GitHub Desktop.
Save mralexjuarez/ba01190893220da211db80f45ccca247 to your computer and use it in GitHub Desktop.
A work-in-progress one hitter quitter install script for Open edX
## A One Hitter Quitter Script to Setup Open edX
## Variables
export CONFIG_DIR="/opt/edx"
export OPENEDX_RELEASE=open-release/ironwood.master
## Usage for the ohq
if [ -z $1 ]; then
echo "Usage: $0 <LMS DOMAIN NAME>"
exit 1
fi
## Setting the LMS variable
LMS=$1
## Configure the hostname to resolve
echo "127.0.1.1 $(hostname)" >> /etc/hosts
## Create the directories
mkdir $CONFIG_DIR
cd $CONFIG_DIR
## Configure the config.yml file.
# I want to read this in from the command line e.g. ohq.sh learn.unsupported.io
# the CMS will add studio to the LMS URL. e.g. studio.learn.unsupported.io
echo "EDXAPP_LMS_BASE: \"$LMS\"" >> $CONFIG_DIR/config.yml
echo "EDXAPP_CMS_BASE: \"studio.$LMS\"" >> $CONFIG_DIR/config.yml
#apt-get -y update && apt-get -y upgrade
## Run the Ansible Bootstrap
wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/ansible-bootstrap.sh -O - | sudo bash
## Run the password generator
wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/generate-passwords.sh -O - | bash
## Get the native script - Still need to edit it.
# Need to modify the requriements.txt file to remove the pip Ansible 2.3 version
wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/native.sh
## Need to modify the requriements.txt file to remove the pip Ansible 2.3 version
## sed the requirement.txt file and then run native.sh
# sed -i "/ansible==2.3.1.0/ansible/g" /var/tmp/configuration/requirements.txt
# Don't think I need to do the sed when using the master branch.
chmod +x /opt/edx/native.sh
/opt/edx/native.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment