Use continuous integration software such as TeamCity , and use a script construct that takes the version number as a parameter. Your build script can simply call the small tool that it just does: open the file (versioninfo.php), find this line (some elements of the regular expression) and replace it with the given parameter.
A few additional tips to ease this: open each version that will be released soon, we now have 5.0 in production (but it is still built with the goal of fixing it), 5.1 is forked and tested at this point, and the trunk contains 5.2.
Each time you will need to release a patch, update the version number in TeamCity and in the call to the build script (which should also be done in TeamCity).
Fe At the moment we have the following projects:
- Version 5.0.5 (which accepts / v = 5.0.5)
- Release 5.1 (which accepts / v = 5.1)
- Trunk (which takes / v = 5.2)
Combine this with the prefix of your SQL scripts with the version number and an automated database creating a script that creates a large script transaction for each version (for example: DPL_Updates_for_5.1.sql).
When we bring the production version, we take artifacts from the TeamCity branch, database scripts specific to this version are automatically added to the zip file, and we give the file (plus release notes, etc.) to our application management department .
source share