-
Notifications
You must be signed in to change notification settings - Fork 3
Cookbook release cycle
damiencorpataux edited this page Aug 22, 2013
·
10 revisions
Scheme: x.y.z (eg. 1.0.0)
- x: Major version: Updated on: Major architecture/conceptual change leading to incompatibilities
- y: Minor version: Updated on: Feature addition, modification, removal
- z: Subminor version: Updated on: Hotfixes
-
Create git branches for features, eg
feature-#128-reporting
- Develop
-
Create a git branch named
release-x.y.z
- Merge the feature branches into the release branch
- Test your release branch (with migration) on http://wwwfbm/iafbm_release
- Notify users to test the release and wait for validation
- Test one last time the features and migration on http://wwwfbm/iafbm_release with production data
- Merge release branch into master
-
Tag the master branch with actual version as label:
x.y.z
- Update and migrate production instance http://wwwfbm/iafbm
- Delete features and release branches
- Create a branch for the feature
git checkout -b new_feature
- Develop, add/move/remove files, commit files, ...
git add/mv/rm [files]
git commit -m"Message" [files]
- Pull master branch modifications into development branch
git checkout master
git pull
- Rebase to master branch to merge master commits with development branch,
resolving potentially arising conflicts
git checkout new_feature
git rebase master
- Merge development branch into master branch (locally)
git checkout master
git merge new_feature
- Push the (locally) merged master branch into remote repository
git push origin master
Source: http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle
- Update the project in iafbm_test environment
cd iafbm_test/iafbm/scripts
php update.php -u -x
- Run the UnitTests
cd iafbm_test/iafbm/tests
php phpunit.php .
- Validate the application quality
- Create a tag in the master branch with the release version
git tag -a 1.0.0
git push --tags
- Update the project in iafbm_prod environment
- Once your SQL files are updated and your migration(s) script(s) are created
- Change directory to a the instance of the application
(eg. your local instance or release instance for testing, or the production instance when testing is complete)
cd /var/www/iafbm
- Make sure you are on the up-to-date master branch (eg. the production branch)
git checkout master
git pull
- Test the migration using the basic database:
# Rebuild the database according the master branch structure
cd scripts
php update -x
# Checkout your release branch
git checkout release-{x}.{y}.{z}
# Run the migration script
cd migration
php {your-migration-script-here}.php
- Test the application and run the unittests
cd /path/to/iafbm
cd unittests
php phpunit.php units
- Now test the migration using the production data
# Retrieve a production database dump
# Dump production database into file
ssh iafbm@wwwfbm mysqldump -uiafbm_prod -p iafbm_prod > iafbm_prod.sql
# Import production database into testing database
mysql -u{user} -p iafbm_prod < iafbm_prod.sql
# Delete dump for privacy concerns
rm iafbm_prod.sql
- Test the application again and run the unittests
cd /path/to/iafbm
cd unittests
php phpunit.php units
- Update the production instance
*/!* Make sure you have thoroughfully tested the deployment on the release instance first
# Merge your release branch into the master branch first
git checkout master
git pull
git merge release-{x}.{y}.{z}
git tag -a {x}.{y}.{z} -m '{your release message}'
git push
git push origin --tags
# Update the production instance
ssh iafbm@wwwfbm
# Backup the data first
mysqldump -uiafbm_prod -p iafbm_prod > iafbm_prod-`date +"%Y-%m-%d"`.sql
# Update and migrate
cd prod/iafbm
git pull
cd scripts/migrations
php {your-migration-script}.php # you might have multiple migration scripts to run
- Test the production application again and run the unittests
cd ~
cd prod/iafbm/unittests
php phpunit.php units
- Simple Workflow: Best practices
http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle - Simple Workflow: The GitHub worlflow
http://scottchacon.com/2011/08/31/github-flow.html - Complex Workflow: Sucessful branching model
http://nvie.com/posts/a-successful-git-branching-model/ - Git book
http://alx.github.com/gitbook/