• livable streets QA release notes

  last modified May 15 by slinkp

Steps for a new Livable Streets QA release

  1. Set up some environemnt variables to make these commands simpler
    export CURRENTRELEASE=ijsselstein
    export NEWRELEASE=joure
    export DEVPREFIX=dev
    export SITE=${DEVPREFIX}.livablestreets.com
    export REQPROF="livablestreets/releases/${NEXTRELEASE}"
    export TODAY=`date +%Y%m%d`
    export USERNAME=[[your username]]
    
  2. cut branches for NEWRELEASE
    # The -N below prevents us from checking out ALL of the past releases, drastically speeding this up
    svn co -N https://svn.openplans.org/svn/deployments/livable-streets
    cd livable-streets
    ./cut-new-releases_locally_single_commit.py ${NEWRELEASE}
    svn ci -m "cutting release branches for ${NEWRELEASE}"
    1. create a new requirements profile for NEWRELEASE
      svn co https://svn.openplans.org/svn/build/requirements/livablestreets/releases
      cd releases
      ./make-next-release.sh ${CURRENTRELEASE} ${NEWRELEASE}
      # THERE IS A MISSING sed STEP RIGHT HERE!!!
      svn ci -m 'create requirements set for ${NEWRELEASE}'
    2. log in to flow, become the openplans user
      ssh flow
      sudo su - openplans
      1. take down current stack
        /usr/local/topp/${SITE}/builds/${CURRENTBUILD}/bin/supervisorctl shutdown
        1. import live database data
          [flow] svn export https://svn.openplans.org/svn/scripts/database-import.sh # Stored in /usr/local/topp/scripts
          [flow] ./database-import.sh livablestreets $DEVPREFIX
          
        2. run the wordpress role migration script on the imported sql database
          cd /usr/local/topp/wordpress_role_migration
          source bin/activate
          ./change-role-migration.py ${DEVPREFIX}_livablestreets_wordpress #[contributor] [author]
          deactivate
          1. move aside the existing ZODB
            mv /usr/local/topp/${SITE}/var/zeo /usr/local/topp/${SITE}/var/zeo.old
            mkdir /usr/local/topp/${SITE}/var/zeo
            1. kick off a new build with the appropriate requirements profile ("livablestreets/trunk" for dev, "livablestreets/releases/NEXTRELEASE" for stage)
              1. /usr/local/topp/${SITE}/newbuild.sh ${REQPROF}
              2. (carefully examine all of the config file diffs to make sure things get set up correctly)
              3. Generally, you want to reject the changes in etc/opencore/gs_profile/properties.xml , accept all of the changes that are just a change of the deploy directory (obvious by the date change) and accept the change for etc/opencore/gs_profile/propertiestool.xml even though they are different, because the correct values will be inserted.
              4. ***Be sure you overwrite etc/opencore/gs_profile/propertiestool.xml since it's values are appended, and will bork things if you leave it***
            2. create symlinks
              ln -s /usr/local/topp/${SITE}/builds/${TODAY} /usr/local/topp/${SITE}/builds/${NEWRELEASE}
              rm /usr/local/topp/${SITE}/current
              ln -s builds/${TODAY} /usr/local/topp/${SITE}/current
                1. move a copy of the live ZODB in its place
                  /usr/local/topp/scripts/copy-live-nycstreets-zodb.sh /usr/local/topp/${SITE} /usr/local/topp/${SITE}/current
                  1. run the woonerf migrations
                    cd /usr/local/topp/${SITE}/current/opencore
                    zeo/bin/zeoctl start
                    zope/bin/zopectl run src/opencore/migrations/migrate-woonerf.py
                    zeo/bin/zeoctl stop    
                    1. get everything in the stack up and running

                      /usr/local/topp/${SITE}/builds/${TODAY}/bin/supervisord
                      /usr/local/topp/${SITE}/builds/${TODAY}/bin/supervisorctl
                      warning, it may take a long time (> 10 minutes) for zeo to fully start the first time after restoring a copy of the live ZODB; it has to recreate the Data.fs.index file. Meanwhile, opencore will fail to start until zeo is fully up. You'll know it's done when zeo prints a line like this to /usr/local/topp/$SITE/var/logs/zeo.log:

                      2008-05-09T14:58:20  INFO ZEO.zrpc (27647) listening on ('', 10102)

                      1. commit any config changes back to the svn repository
                        cd /usr/local/topp/${SITE}/current/etc
                        svn status
                        #(possible 'svn add' or 'svn rm' operations to make sure config is in sync)
                        svn ci -m "committing config changes for ${NEWRELEASE}" --username ${USERNAME}      
                        1. check opencore translation files in Zope root > Control Panel > Translation Service (if paths are wrong delete them and restart zope)
                        2. check uri's in zmi opencore_properties sheet
                        3. check /usr/local/topp/SITE/var/deliverance/hosts
                        bold indicates candidates for better automation