Update on Beyond Compare inside Team Build and why I'm starting to hate TFS
January 30th 2009In the past few days, and nights, I’ve learned a few things. Most are bummers, but there is light at the end of the tunnel. This is what I feel our build process was like for the past few days, but I think we’re doing much better now and things are actually working. (Cross your fingers)
I’ve tried a few approaches yesterday and here is what I’ve found.
Deploying via Ftp
Initially, I tried to deploy to our servers via FTP. This appears to work well, but the timestamps are all adjusted by the GMT offset. In our case, the files end up on the server looking like they were edited 6 hours in the future. This makes every single file appear different on the next sync since none of the time stamps match. Apparently this is by design from Microsoft. What a bummer. Running the development server on GMT will cause the timestamps in the database on that server to also be off. This option is out.
Deploying via file share
Again, this appears to work well. The first time everything goes. We change a single file and the log sees that only one file has changed, but doesn’t move it. Doh! They come out of TFS as read-only, and copying to a file share will carry over those file attributes. No problem.
attrib -r \myServer\myShare\myApp*.*
Nope! You can’t run attrib on a network share. It has to be a physical disk.
OK. Well I’ll just attrib -r the source files in the build’s working directory. Great! That worked. Let’s try it again. Doh!
Unable to perform the get operation because it is writable.
You’re kidding me! Grr…OK! Fine! I’ll attrib +r after I push. Nope! Not every file in the source directory is suppose to be read only and some of them cannot be read only. AHHH!
Oh yes! Beyond Compare has an attrib -r command in the scripting reference.
ATTRIB Usage: attrib (+|-) [(+|-) <...>] Sets (+) or clears (-) the DOS file attributes in the current selection. An attribute set can include archive (a), system (s), hidden (h), and read only (r) attributes. Windows only implementation: Linux version will not recognize ATTRIB.
Sound great right?….that doesn’t work. Even on simple unit test this doesn’t work. I’m at my wit’s end now. There is one more thing to try. There is one more command in the Beyond Compare script reference that might be able to help.
OPTION Usage: option stop-on-error option confirm:(prompt|yes-to-all|no-to-all) Adjusts script processing options. stop-on-error makes the script watch for various error conditions, including file operation errors, and, when one occurs, prompts the user before continuing. confirm can use prompt, yes-to-all, or no-to-all to handle confirmation dialogs that occur due to file operations. By default, prompt is used.
Let’s hope this works. I’ll put it right before the sync, cross our fingers and run it through some tests.
It WORKS! Or it appears to so far. Hopefully.
The files on the server still carry the read only flag. That’s not ideal for us, but it will have to do for now.
