Invalid Object
computers, programming, science fiction, beer
20100919
20100224
20100107
TFS Build Adventure
We moved to TFS in 2009. Source control itself was a great improvement from VSS. But it became my job to manage the continuous integration process.
I remember a java project I was on where our architect set up cruise control to deliver the latest version of the nightly build to the web server every night. I want to set up something like that myself.
Setting up the build wasn't too tough. It makes a directory that contains all the products from the build in one big list. The websites themselves are in subdirectories called "_Published Websites".
First goal: how to get the build service to copy the files to the inetpub directory.
First of all, this thing is a monster. MSBuild and TFSBuild, which read the .proj files to perform builds, have their own four-hundred page instruction manual. Just trying to read this thing to get a hint of what to do is overwhelming. So I decided to start with something simple. Just copying some files after the build is done.
There seems to be more than one way of doing the same thing. I tried to do the simplest thing possible. I just wanted the build to copy the website to publish to the inetpub directory of the development web server. So I borrowed from the code listed here and added this to the end of the TFSBuild.proj file:
</ItemGroup>
<Target Name="BeforeTest">
<CreateProperty value="w:\inetpub\gavintest">
<Output TaskParameter="Value" PropertyName ="MyDropLocation" />
</CreateProperty>
<Exec Command='xcopy /y /e "$(OutDir)_PublishedWebsites\AgileGaWeb" $(MyDropLocation)' />
</Target>
Here's what this code did: It overrides the BeforeTest target. Each target is run in succession by the default build process. This code just replaces the "BeforeTest" target to inject its own action.
The first thing we do is create a property we can pass to the Exec command below. The property is "MyDropLocation", which is the path to the virtual directory.
Then we execute the xcopy command and pass it the source as a constant and the destination as the property. I already set up the directory.
Queue up the build and voila! The new app is deployed with the automatic build.
Future Topics:
Running unit tests
Variable substitution in config files
I remember a java project I was on where our architect set up cruise control to deliver the latest version of the nightly build to the web server every night. I want to set up something like that myself.
Setting up the build wasn't too tough. It makes a directory that contains all the products from the build in one big list. The websites themselves are in subdirectories called "_Published Websites".
First goal: how to get the build service to copy the files to the inetpub directory.
First of all, this thing is a monster. MSBuild and TFSBuild, which read the .proj files to perform builds, have their own four-hundred page instruction manual. Just trying to read this thing to get a hint of what to do is overwhelming. So I decided to start with something simple. Just copying some files after the build is done.
There seems to be more than one way of doing the same thing. I tried to do the simplest thing possible. I just wanted the build to copy the website to publish to the inetpub directory of the development web server. So I borrowed from the code listed here and added this to the end of the TFSBuild.proj file:
</ItemGroup>
<Target Name="BeforeTest">
<CreateProperty value="w:\inetpub\gavintest">
<Output TaskParameter="Value" PropertyName ="MyDropLocation" />
</CreateProperty>
<Exec Command='xcopy /y /e "$(OutDir)_PublishedWebsites\AgileGaWeb" $(MyDropLocation)' />
</Target>
Here's what this code did: It overrides the BeforeTest target. Each target is run in succession by the default build process. This code just replaces the "BeforeTest" target to inject its own action.
The first thing we do is create a property we can pass to the Exec command below. The property is "MyDropLocation", which is the path to the virtual directory.
Then we execute the xcopy command and pass it the source as a constant and the destination as the property. I already set up the directory.
Queue up the build and voila! The new app is deployed with the automatic build.
Future Topics:
Running unit tests
Variable substitution in config files
Labels:
programming
20091112
Asimov and the TRS-80
Cool things about this picture in order of priority:
- Pocket TRS-80
- Sideburns
- Bolo tie
- Birth-control classes
- Asimov
Labels:
computers
20091109
Windows Command-line Fu
This command executes the contents of your SQL script from a command line:
sqlcmd -S ServerName\InstanceName -d DatabaseName -i test.sql
This command iterates through every file in a given directory: (and just echoes it to standard out)
for /R %f IN (dir *.sql) DO echo %f
Put them together and you can execute all the scripts in a given directory:
for /R %f in (dir *.sql) DO sqlcmd -S ServerName\InstanceName -d DatabaseName -i %f
Labels:
programming
20091105
Smartphone time?
My Verizon service is good because it works well everywhere I go, but there are no decent smartphones available for the service because it doesn't use the more modern cell tower technology. This week I found out Verizon is going to offer a smartphone running the Android operating system. This is exciting to me because I am addicted to the services Google offers, especially with communication and calendering.
So how much would this cost me? Turns out I could get the phone for a hundred bucks, which isn't too bad, but I have to commit to another two years of service. That sucks a little. And I'd have to pay the data fee. I'd have to pay another $20 per month for two years, and that's $480 more bucks! I'm thinking if I want a handheld gadget that syncs with Google, I ought to consider the iPod Touch instead. I can still listen to music, sync with Google, read Kindle books, and I can just do the sync thing in my house with 802.11 rather than the expensive data plan.
So how much would this cost me? Turns out I could get the phone for a hundred bucks, which isn't too bad, but I have to commit to another two years of service. That sucks a little. And I'd have to pay the data fee. I'd have to pay another $20 per month for two years, and that's $480 more bucks! I'm thinking if I want a handheld gadget that syncs with Google, I ought to consider the iPod Touch instead. I can still listen to music, sync with Google, read Kindle books, and I can just do the sync thing in my house with 802.11 rather than the expensive data plan.
Labels:
computers
20091104
Rogue Dead Guy Ale
A few months ago, this was the beer of the week at RFD. I drank two or three of them and they were quite good. I bought a six-pack last weekend for about $11. That's more than I would normally spend on microbrews, but it was really good!
I think it tastes better on tap. Considering it was the week of Halloween, I guess I can say it was in the spirit of the holiday. But Dogfish Head seems to be a better buy.
I think it tastes better on tap. Considering it was the week of Halloween, I guess I can say it was in the spirit of the holiday. But Dogfish Head seems to be a better buy.
Labels:
beer
Subscribe to:
Posts (Atom)



