diff --git a/playbooks/small_deployments/deploy-application.sh b/playbooks/small_deployments/deploy-application.sh deleted file mode 100755 index 2cf5beda548..00000000000 --- a/playbooks/small_deployments/deploy-application.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -## -## Run the deploy-application.yml playbook in the configuration/playbooks directory -## -cd /var/tmp/configuration/playbooks/small_deployments/ && sudo ansible-playbook -c local ./deploy-application.yml -i "localhost," -e@ansible_overrides.yml \ No newline at end of file diff --git a/playbooks/small_deployments/deploy-common.sh b/playbooks/small_deployments/deploy-common.sh deleted file mode 100755 index 108ae68680a..00000000000 --- a/playbooks/small_deployments/deploy-common.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -## -## Run the deploy-common.yml playbook in the configuration/playbooks directory -## -cd /var/tmp/configuration/playbooks/small_deployments/ && sudo ansible-playbook -c local ./deploy-common.yml -i "localhost," -e@ansible_overrides.yml \ No newline at end of file diff --git a/playbooks/small_deployments/deploy-datasource.sh b/playbooks/small_deployments/deploy-datasource.sh deleted file mode 100755 index 6f9ca235bb6..00000000000 --- a/playbooks/small_deployments/deploy-datasource.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -## -## Run the deploy-datasource.yml playbook in the configuration/playbooks directory -## -cd /var/tmp/configuration/playbooks/small_deployments/ && sudo ansible-playbook -c local ./deploy-datasource.yml -i "localhost," -e@ansible_overrides.yml \ No newline at end of file diff --git a/playbooks/small_deployments/pre_install.sh b/playbooks/small_deployments/pre_install.sh deleted file mode 100755 index b3909b5551d..00000000000 --- a/playbooks/small_deployments/pre_install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -## -## Installs the pre-requisites for running edX on a multiple instance Ubuntu 14.04 instance. - - -## -## Set ppa repository source for gcc/g++ 4.8 in order to install insights properly -## -sudo apt-get install -y python-software-properties -sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - -## -## Update and Upgrade apt packages -## -sudo apt-get update -y -sudo apt-get upgrade -y - -## -## Install system pre-requisites -## -sudo apt-get install -y build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-pip libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc-4.8 g++-4.8 -sudo pip install --upgrade pip==8.1.2 -sudo pip install --upgrade setuptools==24.0.3 -sudo -H pip install --upgrade virtualenv==15.0.2 - -## -## Update alternatives so that gcc/g++ 4.8 is the default compiler -## -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 - -## -## Clone the configuration repository and run Ansible -## -cd /var/tmp -git clone https://github.com/danilkuznetsov/configuration -cd configuration -git checkout open-release/eucalyptus.juja - -## -## Install the ansible requirements -## -cd /var/tmp/configuration -sudo -H pip install -r requirements.txt diff --git a/playbooks/small_deployments/run.sh b/playbooks/small_deployments/run.sh new file mode 100755 index 00000000000..d3b2d1f9140 --- /dev/null +++ b/playbooks/small_deployments/run.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash + +# Makes this more verbose. +set -x + +# Stop if any command fails. +set -eset -x + +BASE_DIR = "/var/tmp/edx-install" +TYPE = "application" + +show_help () { + cat << EOM + +Install or Upgrades open edx node. + +-t TYPE + Type node: application, common, datasource +-h + Show this help and exit. + +EOM +} + +# override defaults with options +while getopts "h:t" opt; do + case "$opt" in + h) + show_help + exit 0 + ;; + t) + TYPE=$OPTARG + ;; + esac +done + +if [[ -d ${BASE_DIR} ]]; then + ## + ## Update configuration repository + ## + cd $BASE_DIR/configuration + git pull origin open-release/eucalyptus.juja + + ## + ## Update private settings repository + ## + cd $BASE_DIR/secure + git pull origin master +else + echo "Create base directory and install configuration" + mkdir -p $BASE_DIR + cd $BASE_DIR + + ## + ## Set ppa repository source for gcc/g++ 4.8 in order to install insights properly + ## + sudo apt-get install -y python-software-properties + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + + ## + ## Update and Upgrade apt packages + ## + sudo apt-get update -y + sudo apt-get upgrade -y + + ## + ## Install system pre-requisites + ## + sudo apt-get install -y build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-pip libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc-4.8 g++-4.8 + sudo pip install --upgrade pip==8.1.2 + sudo pip install --upgrade setuptools==24.0.3 + sudo -H pip install --upgrade virtualenv==15.0.2 + + ## + ## Update alternatives so that gcc/g++ 4.8 is the default compiler + ## + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 + + ## + ## Clone the configuration repository + ## + git clone https://github.com/danilkuznetsov/configuration + + ## + ## Clone the private settings repository + ## + git clone https://bitbucket.org/dkuznetcov/juja-private-settings secure + + ## + ## Install the ansible requirements + ## + cd $BASE_DIR/configuration + git checkout open-release/eucalyptus.juja + sudo -H pip install -r requirements.txt + +fi + +## +## Install the ansible requirements +## + +cd $BASE_DIR/configuration/playbooks/small_deployments/ && sudo ansible-playbook -c local ./deploy-${TYPE}.yml -i "localhost," -e@$BASE_DIR/secure/edx_overrides/ansible_overrides.yml \ No newline at end of file