Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Update scripts/update_prod.sh #59

Merged
merged 1 commit into from
Dec 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 28 additions & 40 deletions scripts/update_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,47 @@
set -e

SVN="/usr/bin/svn"
INPUT_DIR="/data/input/python/input.mozilla.com/reporter"
PYTHON="/usr/bin/python26"
INPUT_DIR="/data/sync/input/src/django/input.mozilla.com/reporter"
VENDOR_DIR="$INPUT_DIR/vendor"

SYNC_DIR="/data/input/www/django/input.mozilla.com/reporter/"

# update locales
pushd locale > /dev/null
$SVN revert -R .
$SVN up
#$SVN up
./compile-mo.sh .
popd > /dev/null

#update vendor
echo -e "Updating vendor..."
cd $VENDOR_DIR
git pull
git submodule sync
git submodule update --init --recursive

# update input.mozilla.org code in src tree
echo -e "Updating reporter..."
cd $INPUT_DIR
git fetch origin

# Note: We're deploying from the master branch now to shave off some
# workflow steps because this is a dead project. (willkg)
git checkout origin/master
git submodule update --init

cd /data/input;
/usr/bin/rsync -aq --exclude '.git*' --delete /data/input/python/ /data/input/www/django

cd $SYNC_DIR
# FIXME: Commenting this out because it's not working.
# /usr/bin/python26 $VENDOR_DIR/src/schematic/schematic migrations

# Pull in highcharts.src.js - our lawyers make us do this.
/usr/bin/python26 $INPUT_DIR/manage.py cron get_highcharts
/usr/bin/python26 $INPUT_DIR/manage.py compress_assets
mkdir -p $INPUT_DIR/static
/usr/bin/python26 $INPUT_DIR/manage.py collectstatic --noinput --clear
# Grab up to date product details
/usr/bin/python26 $INPUT_DIR/manage.py update_product_details

# FIXME: Commenting this out because it's not working.
# if [ -d $SYNC_DIR/migrations/sites ]; then
# /usr/bin/python26 $VENDOR_DIR/src/schematic/schematic migrations/sites
# fi

# Clustering commented out because it takes too long during release.
# If urgent, start by hand (in a screen). If not urgent, wait until clustering
# cron job reoccurs.
#su - apache -s /bin/sh -c '/usr/bin/python26 /data/input/www/django/input.mozilla.com/reporter/manage.py cron cluster'

/data/input/deploy
#/data/bin/omg_push_generic_live.sh .

#/data/bin/issue-multi-command.py generic 'service httpd reload'
git pull origin master

# sync to www tree, which web servers get, without .git* and .svn*
/usr/bin/rsync -aq --exclude '.git*' --delete /data/sync/input/src/ /data/sync/input/www/

# compress assets
$PYTHON $INPUT_DIR/manage.py compress_assets

# check if static dir exists, make if nto
if [ ! -d $INPUT_DIR/static ]; then
echo "making static dir"
mkdir -p $INPUT_DIR/static
fi

# collect static assets to static/
$PYTHON $INPUT_DIR/manage.py collectstatic --noinput --clear

# commit to git for web servers to pull from
git commit -a -m "push to prod"

issue-multi-command input /data/bin/libget/get-php5-www-git.sh
sleep 60
issue-multi-command input service httpd restart