We have a nightly build of TeamCity, which releases the latest code on our test site, restores the database according to the production, and then applies any changes to the schema and data that we have in TFS. If this nightly assembly failed, the website does not work until we manually fix the code and / or database scripts and restart the assembly.
I would like to automatically roll back to the last successful build, so the website is accessible, despite any break in work.
After spending some time investigating, here is my suggested solution:
- Nightly builds are done by creating a new tag in TFS (something like Nightly-build- {build number})
- Create a new TeamCity build that starts after the buildโs overnight build
- Find the last successful nightly build number
- Get version related to this build number tag in TFS
- Rollback assembly (it does not matter, only the night assembly completed successfully)
What I don't know is how to create a rollback version based on a shortcut.
Any help for this or another solution would be appreciated.
Greetings.
jfc37 source share