Roll out your code to production

kej edited this page May 9, 2012 · 4 revisions

If a Release is completed and all tests are green we may start the process of rollout.

To check if everything would roll out as expected we keep a staging environment which is a 1:1 copy of production (including database content).

STEP 0

To make sure we can still apply patches to the current release after rollout we create a new branch for the version to be rolled out (let's call it staging-branch-007). This ensures that the development may continue normally in the default branch and any mistakes found in staging (during the week of testing) can be applied to the staging-branch-007 without the need to manually sort out changes from the default.

hg branch v0.8
hg commit -m "constructing staging-branch-007" 
hg push
hg push --staging-branch-007

STEP 1

To make sure all recent changes in production data are incorporated in the staging environment we first run following script, which is situated in the /ext folder of the repository:

copy-production-state-to-staging.sh

The script dumps the current production database as well as a tar of all files uploaded by users. The dump is then copied into staging database and file folders.

TODO : before starting rollout the site should be set to maintanance mode (not implemented yet) to avoid changes.

STEP 2

Having done this we can pull in all recent code-changes and run new migrations on the staging system. This is best done using the version specific script. The original script is also located in the /ext folder:

update-and-migrate.(VERSION).sh

By doing this we now know if any errors would occur on the rollout to production. Remember to either edit the script to update to the versions branch in the final step or do this manually after running the script (e.g. hg update v0.7 -C ). Also Correct the number of migrations to run and correct it in the script.

STEP 3

Verify manually the content of our portal to be as expected. Wait for at least a few hours :)

STEP 4 - Rollout to production

Repeat step 2 and step 3 for production system.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.