I am launching a rather complicated project with several independent applications. However, they use several common components. So I have a source tree looking something like below.
- My project
- Appendix A
- Shared1
- Shared2
- Appendix B
- Appendix C
All applications have their own MSBuild script, which builds the project and all the resources it needs. I also run these builds on a server with continuous integration into CruiseControl.
When deploying applications, they are deployed to multiple servers to distribute the load. This means that it is extremely important to keep track of which version of the assembly / revision is deployed on each of the different servers (we need to have the current version in the version of the DLL, for example, "1.0.0.68").
It is equally important to be able to recreate the revision / assembly that was built in order to be able to roll back if something did not work out as intended (yes, this happens ...). SourceSafe was used today for version control, but it could be changed if we could provide good reasons for this (SS actually works fine for us so far).
Another principle that we are trying to execute is its only code, which was created and tested by the integration server, which we deploy further.
CrusieControl Label Design
We had several ideas for solving the above. The first one was to build a continuous integration server and locally deploy the project and test it (now it does). As you probably know that a successful build in CruiseControl generates an assembly label, and I assume that we can somehow use it to install the DLL version of our executable files (so assembly label 35 will create a DLL, for example, "1.0 .0.35 ")? The idea was also to use this assembly label to indicate the complete source tree. Then we can probably check this shortcut and recreate the assembly later.
The reason for marking the entire tree is the inclusion of not only the actual application code (that is, in one place in the source tree), but also of all common elements (this is in different places in the tree). Thus, a successful build of “Application A” will be indicated by the entire tree as “ApplicationA35”, for example.
However, when trying to recreate this assembly and install the version of the DLL before deployment, a problem may arise, since then we do not have access to the shortcut of the generated CruiseControl assembly. If all the shortcuts of the CrusieControl assembly were unique for all projects, we could use only the number for marking, but this is not so (both applications A and B could at the same time be in assembly 35), so we must include the name of the application in the label. Therefore, the SourceSafe shortcut is “Application35”. How can I then recreate assembly 34 and install 1.0.0.34 for DLL version numbers after we build assembly 35?
Revision Number Solution
Someone told me that Subversion, for example, creates a version number for the entire source tree at each check - is this the case? Does SourceSafe have something like this? . If so, the idea is to grab this version number when getting the latest information and build on the CruiseControl server. You can then use the version number to set the version number of the DLL (for example, "1.0.0.5678"). I assume that then we could get this specific revision for Subversion, if necessary, and then it will include this application and all the common elements in order to be able to recreate a specific version from the past. Will this work, and can it be achieved using SourceSafe?
Summarize
So, two basic requirements:
- Be able to track the assembly / version number of the assembly and the deployed DLL.
- To be able to rebuild the previous revision / assembly, set the old assembly / revision number in the executable files of this assembly (in order to comply with requirement 1).
So how would you solve this? . What will be your preferred approach and how would you solve it (or do you have a completely different idea?)? ** Nice to give detailed answers. **
Question with a bonus. What is the difference between revision number and build number and when do you really need both?