Updating VCS post-build
A small team of us has been tasked to migrate an existing build process using SourceGear Vault and batch scripts to using GitHub and TeamCity, but there are some steps that we're not sure how to integrate.
There are steps where the existing script will check out files from the VCS, modify them, and then check them back in. Specifically in one case the build number.
Best I can see right now using TeamCity is a script in the build process to update the files as intended, but the state on GitHub would never be updated. What I've read was that TeamCity does not like doing this but I have to imagine other development teams have had this issue too, does anyone have some best practices to recommend?
Please sign in to leave a comment.
I have had to do this using VisualSVN - the only way I managed to complete this was to write a powershell step to complete this task - in fgact I had to write 2 steps, 1 to checkout the files into a known location and then one to update and checkin the new files.
Does the script get run as a build step? Part of the concern is not causing a loop. The script changes the state, the change of state causes a build, a build causes the script to run.
Hi Paul,
it is part of a build step - the way I got around the loop was to place the resultant files in a separate part of the repository, set up VCS trigger rules to only look for checkins on the input files path - my process is;
I check out the input files (for want of a better description) using TeamCity into a working folder
I create a step to checkout a copy of the processed files into a folder within the working folder TeamCity has created me
I complete the build steps on the input files
I create a step that copies the newly created .dll's into the folder earlier created (overwriting the files there)
Then finally I run a step that checks in the processed files
It is a very rough way to do it but TeamCity is only monitoring the VCS root for the input files - so when the processed files are checked back in it doesn't recognise a change or register a pending change.
I hope this makes sense
PJ
Sorry for the delayed reply had some meetings, yes that does make sense. I managed to use a -:/ / rule to explicitly target (and ignore) what I wanted with success. Thank you very much!