Deployment Process

Deployment/Release process 2010-11-11
This procedure is to only be conducted with authorization from Ryan, Garth or Jess. It normally happens on the scheduled release days.

PRE-RELEASE WORK 1) Prepare schema changes 2) Clone the svn repo that is going to be changed and stick it into a new repo 3) Check for collisions ON RELEASE DAY 1) Inform the masses 2) Put the site into maintenance mode 3) Schema changes 4) do a schema only mysqldump for each db: 5) compare each schema against the love machine schema: 6) updating schema changes 7) update schema changes from step files to the dbs that need it, basically file with MYLINE update with the changes from SOURCEFILE: for db in $(grep -l "^${MYLINE}" *.out); do mysql -h mysql.dev.sendlove.us -e "source ${SOURCEFILE} " ${db%.out}; done 8) check for schema consistency 9) then diff again to make sure there are not issuse: 10) move the current production repo to it's previous backup dir (if the newest is a5, the previous dir would be a4), eg: 11) now move back to the production .htaccess
 * compile schema changes into separate files.
 * sample filenames: step1.l234 step2.l253  step3.l92  (l# == line number)
 * GARTH PLEASE EXPAND HERE IF NEED BE OR REMOVE THIS LINE
 * mkdir login5; cd login5
 * tar -C ../login -cf - . |tar -xf -
 * svn up for login5 to check for any collisions; fix if any
 * login5 is now ready to be moved to 'login' as the production repo AFTER the schema changes are made
 * Tell people in the journal that the maintenance is going to be happening.
 * do this work on the production webserver
 * go to the doc root: /mnt/ebsvol/cluster/www/htdocs/
 * if there is a .htaccess file, mv .htaccess_maintenance .htacess
 * note: .htaccess_maintenance puts the site into maintenance mode. .htaccess_default puts it back into production
 * do this work on the mysql master
 * list of all the active dbs:
 * echo "show databases like 'LM_%'" | mysql cupid_dev > dbnames
 * remove organic/header/lm_tmp from dbnames
 * for DB in $(cat dbnames); do mysqldump -h mysql.dev.sendlove.us -d ${DB} | sed -e 's/ AUTO_INCREMENT=[0-9]\+//' > ${DB}.schema; done
 * for dbname in $(cat dbnames); do diff LM_lovemachine.schema ${dbname}.schema|grep -v "Dump complete" >  ${dbname}.out; done
 * set variables (examples), note that these variables will be changed for each schema change that is done:
 * export MYLINE=253 (corresponds to the line number in the filename
 * export SOURCEFILE=/root/schema/m5/step2.l253
 * remove outfiles and redo the schema dump of the dbs:
 * rm -f *schema *.out
 * for DB in $(cat dbnames); do mysqldump -h mysql.dev.sendlove.us -d ${DB} |sed -e 's/ AUTO_INCREMENT=[0-9]\+//' > ${DB}.schema; done
 * for dbname in $(cat dbnames); do diff LM_lovemachine.schema ${dbname}.schema|grep -v "Dump complete" >  ${dbname}.out; done
 * mv admin a4; mv a5 admin
 * mv login login4; mv lg5 login
 * mv .htaccess.default .htaccess