Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Roll out your code to production
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).
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
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:
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.
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:
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.
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.