Commit c951525a by Sef Kloninger

temporary update script

Until we get proper software updates working we need a script we can run
to orchestrate installs -- checkouts, collectstatic, restarts.  Tagged
with the "update" tag.  Just puts the file out there for now, doesn't
actually do any updates, that should be done with something like this:
    ansible GROUPNAME -i ./ec2.py -c ssh -s -a edx-update.sh
parent 1f20196d
#!/bin/bash
function usage() {
echo "update.sh [cms|lms|all|none]"
echo " option is what services to collectstatic and restart (default=all)"
}
if [ $# -gt 1 ]; then
usage
exit 1
fi
if [ $# == 0 ]; then
do_CMS=1
do_LMS=1
else
case $1 in
cms)
do_CMS=1
;;
lms)
do_LMS=1
;;
both|all)
do_CMS=1
do_LMS=1
;;
none)
;;
*)
usage
exit 1
;;
esac
fi
function run() {
echo
echo "======== $@"
$@
}
source /etc/profile
source /opt/edx/bin/activate
export PATH=$PATH:/opt/www/.gem/bin
cd /opt/wwc/mitx
BRANCH="origin/feature/edx-west/stanford-theme"
export GIT_SSH="/tmp/git_ssh.sh"
run git remote update
run git checkout $BRANCH
if [[ $do_CMS ]]; then
export SERVICE_VARIANT=cms
run rake cms:gather_assets:aws
run sudo restart cms
fi
if [[ $do_LMS ]]; then
export SERVICE_VARIANT=lms
run rake lms:gather_assets:aws
run sudo restart lms
fi
...@@ -51,3 +51,4 @@ ...@@ -51,3 +51,4 @@
tags: tags:
- pre_install - pre_install
- include: software_update.yml
---
- name: edx-update.sh, manual lms/cms update script
copy: src=roles/common/files/edx-update.sh dest=/usr/local/bin/edx-update.sh owner=ubuntu group=adm mode=0775
tags:
- update
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