<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the tar pit &#187; asp.net mvc</title>
	<atom:link href="http://blog.goneopen.com/tag/asp-net-mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.goneopen.com</link>
	<description>Thrashing around in the stickiness of software</description>
	<lastBuildDate>Mon, 09 Jan 2012 23:35:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MSBuild deployment sample for web applications</title>
		<link>http://blog.goneopen.com/2010/01/msbuild-deployment-sample-for-web-applications/</link>
		<comments>http://blog.goneopen.com/2010/01/msbuild-deployment-sample-for-web-applications/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 00:54:35 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[msbuild]]></category>

		<guid isPermaLink="false">http://blog.goneopen.com/2010/01/msbuild-deployment-sample-for-web-applications/</guid>
		<description><![CDATA[Check out the code sample Download the Deployment Code Sample from github and select to download the zip archive of the source Overview of the code VERSION.xml build.bat build.proj lib/ MSBuildCommunityTasks/ extensionpack/ migratordotnet/ sdc/ teambuild/ scripts/ build.tasks db/ create.sql domainuser-for-db.sql drop.sql user-for-db.sql db-setup.tasks deploy.proj directorybrowsing.xml install.tasks migrations.tasks package.tasks version.tasks src/ Infrastructure/ Database/ Migrations/ Migr_001_CreateBanner_Table.cs Sql/ [...]]]></description>
			<content:encoded><![CDATA[<h1>Check out the code sample</h1>

<p>Download the <a href="http://github.com/toddb/msbuild-deployment-sample">Deployment Code Sample</a> from github and select to download the zip archive of the source</p>

<h1>Overview of the code</h1>



<pre>
    VERSION.xml
    build.bat
    build.proj

    lib/
        MSBuildCommunityTasks/
        extensionpack/
        migratordotnet/
        sdc/
        teambuild/
    
    scripts/
        build.tasks
        
        db/
            create.sql
            domainuser-for-db.sql
            drop.sql
            user-for-db.sql
        
        db-setup.tasks
        deploy.proj
        directorybrowsing.xml
        install.tasks
        migrations.tasks
        package.tasks
        version.tasks
    
    src/
        Infrastructure/
            Database/
                Migrations/
                    Migr_001_CreateBanner_Table.cs
                Sql/
                    migration-latest.sql
        Sample.sln
        UI/

    tools/
        [these are needed to be installed on machines]
</pre>



<h1>Explanation/Overview of files and folders</h1>

<p><dl><br />
<dt><code>VERSION.XML</code></dt><br />
<dd>This holds the major, minor and revision number for the product. This is effectively the marketing name of the product and is changed rarely. This &#8220;version&#8221; combined with the revision number from the source control is what is used to version <span class="caps">DLL</span>s.</dd></p>

<p><dt><code>build.bat</code> and <code>build.proj</code></dt><br />
<dd><code>Build.bat</code> is the merely a <span class="caps">GUI</span>-based, double-click runner for invoking msbuild file <code>build.proj</code>. <code>Build.proj</code> is a manifest file allowing access to the real worker tasks in the <code>scripts/</code> folder.</dd></p>

<p><dt><code>lib/</code></dt><br />
<dd>As you would expect holds all the dependent libraries. I always bundle up my script files ensuring that they are available in every environment. This project demonstrates the use of three msbuild libraries. Each have there strengths so I just use as needed and don&#8217;t get too hung up about which one. I often also bundle up the Visual Studio teambuild targets because this allows me to avoid having to install the correct version of Visual Studio on the build server (this problem has got better over time and haven&#8217;t reviewed problems here in a whiles).</dd></p>

<p><dt><code>scripts/</code></dt><br />
<dd>This is the focus of the sample. I keep my build scripts in their own folder as to not clutter up root and I keep them out of <code>src/</code> so that I get better reuse and a cleaner folder. I also keep my initial database creation scripts here too. These are the first-time creation scripts rather than the migration scripts which are in <code>src/Infrastructure/Database/</code></dd></p>

<p><dt><code>src/</code></dt><br />
<dd>Here&#8217;s the home of the application code. A couple of conventions, the demo is using a domain-driven-design naming conventions (UI, infrastructure) and java too (src cf Source). Importantly, I see that database work such as schema changes and data transformations are tightly coupled with the application code. Hence they are part of the application code base. I think this type of versioning is far simpler. There is a good blog entry that I can&#8217;t find that compares the &#8220;migration approach&#8221; versus the database compare. Both work compared with the free for all I see &#8211; I just prefer migrations and have never found its simplicity to cause problems. Plus it allows me to go up and down in migrations. The UI code is there just for illustrative purposes so that there is something to deploy.</dd></p>

<p><dt><code>tools/</code></dt><br />
<dd>All this binary packages that need to be installed on the target machine to make the system work but can&#8217;t be (or shouldn&#8217;t be bundled). If my packaging strategy is to &#8220;download-and-deploy&#8221; my source code strategy is to &#8220;checkout-and-compile&#8221;. So I want as much as possible available with source so that in two year&#8217;s time I don&#8217;t have to go looking. It is surprising how this pushes some people&#8217;s buttons.</dd><br />
</dl></p>

<h1><span class="caps">MSB</span>uild files: <code>proj</code> vs <code>tasks</code> vs <code>xml</code></h1>

<p>My assumption is that you know how msbuild works and the structure of the xml files. I use three extensions to mark out different types. Yet, they all follow the xml schema definition for msbuild.</p>

<p><dl><br />
    <dt><strong>proj:</strong></dt><br />
    <dd>a file to be run by msbuild &#8211; hopefully the only one in the folder so that you don&#8217;t have to specify it</dd><br />
    <dt><strong>tasks:</strong></dt><br />
    <dd>a specific set of tasks that is included/imported into a <strong>proj</strong> file and allows for clarity of purpose and reuse<dd><br />
    <dt><strong>xml:</strong></dt><br />
    <dd>a set of properties that are imported into a <strong>task</strong> or <strong>project</strong> file</dd><br />
</dd></p>]]></content:encoded>
			<wfw:commentRss>http://blog.goneopen.com/2010/01/msbuild-deployment-sample-for-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

