<?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>Adam Gabor</title>
	<atom:link href="http://openmakesoftware.com/blogs/adamgabor/feed/" rel="self" type="application/rss+xml" />
	<link>http://openmakesoftware.com/blogs/adamgabor</link>
	<description>Software Build, CI and Testing Automation</description>
	<lastBuildDate>Thu, 05 Feb 2009 22:47:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Convention over Configuration in Build and Release management</title>
		<link>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/convention-over-configuration-in-build-and-release-management/</link>
		<comments>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/convention-over-configuration-in-build-and-release-management/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 22:47:20 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Application Environments]]></category>
		<category><![CDATA[Build Management]]></category>
		<category><![CDATA[Build Tools]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[File Control Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OpenMake]]></category>
		<category><![CDATA[Release Management]]></category>
		<category><![CDATA[SCM Strategy]]></category>

		<guid isPermaLink="false">http://openmakesoftware.com/mavericks/2009/02/05/convention-over-configuration-in-build-and-release-management/</guid>
		<description><![CDATA[I&#8217;ve recently been learning the Ruby on Rails framework for web development. It&#8217;s become a quite popular framework for getting database connected websites up and running relatively quickly. One way it is easier to get a site started than with other frameworks is because of the Convention over Configuration mantra that it lives by. Instead [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been learning the Ruby on Rails framework for web development. It&#8217;s become a quite popular framework for getting database connected websites up and running relatively quickly. One way it is easier to get a site started than with other frameworks is because of the Convention over Configuration mantra that it lives by. Instead of requiring loads of configuration files to build a basic site (that can grow and become quite complex by the way) it has a feature called scaffolding which automatically builds your Model, View and Controller classes based on tables it finds in the database. It can do this by making assumptions based on standard conventions about interacting with a database from a website and naming and using classes in a standard way.</p>
<p>Although I am still a rookie when it comes to understanding the many facets of Ruby on Rails, I have really been trying to emulate the Convention over Configuration way of doing things in my various build/release projects at customer sites. One problem I inevitably encounter in most organizations is that the development of build and release methodologies has been left to the various development teams and not been thought about holistically using a centrally managed approach &#8211; this leads to little to no standards and Convention over Configuration is chucked aside. Not only is this inefficient from an organizational standpoint &#8211; why reinvent the wheel over and over again for each team when they are essentially tackling the same sets of problems, but it also makes for a nightmarish audit trail that could get you into trouble.</p>
<p>One reason this happens so frequently is that the managers that are supposed to be in charge of standards for building and releasing applications are often not privy to the kind of technical requirements that the various development units have when it comes to putting together and delivering their applications. And when developers try to explain the requirements, the standards people may get lost because they can&#8217;t possibly understand the nuts and bolts of every application.</p>
<p>To pull off real centralized management of builds and deployments, the standards people need to take a deep breath and rethink their objectives &#8211; start looking for the commonalities, not the differences between applications. In doing this, they will find that that problem that that developer told you was so unique and must be solved a certain way is probably very similar to the problem the other developer told you about last week &#8211; or just look on the web and see how many thousands of external developers have this same &#8220;unique&#8221; problem. It turns out that most applications can be constructed in the same type of way. Just because the source files are different between applications doesn&#8217;t mean that the paths they take to their target executable, dll, Jar, War or Ear file is very different at all. And when those paths are essentially the same &#8211; create a reusable process that the various teams can share. Use Convention over Configuration as your guide &#8211; standardize and centralize the common processes and externalize the technical specifications using highly modularized control files.</p>
<p>Here&#8217;s a simple task for you to try. This assumes all of your application teams have their code checked into a central repository &#8211; if not, you have bigger problems than standardizing builds and releases and should address those first. Look at your various technologies, whether it&#8217;s .Net, Java or some other and try to identify where the code tree&#8217;s start under the root of the project. You&#8217;d be amazed at how many teams check their .Net solutions into different levels of a code tree for no good reason, or Java teams that have their their source packages buried some place in the code tree. Next, look for the common root starting point for all these application types and try to come up with a simple standard based on this information. Finally, notify those that are not following that standard that you would like to move their code up and over to this new location (its usually up and not down) &#8211; it should actually be pretty easy to do. After this has been done, you can now have all build and deploy scripts use a standard root variable to find dependencies (think something like SOURCE_ROOT).</p>
<p>It always amazes me how many teams don&#8217;t standardize simple things like code tree start points in their source projects &#8211; it equally amazes me how much mileage you can get just out of making simple path standardization adjustments. After you&#8217;ve worked on the source tree, try doing the same with your common libraries. This isn&#8217;t rocket science &#8211; just remember, Convention over Configuration makes everything easier.</p>
<p>Adam</p>
<img src="http://openmakesoftware.com/blogs/adamgabor/wp-content/plugins/pixelstats/trackingpixel.php?post_id=91&amp;ts=1268494264" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/convention-over-configuration-in-build-and-release-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a Windows process as specified user</title>
		<link>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/running-a-windows-process-as-specified-user/</link>
		<comments>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/running-a-windows-process-as-specified-user/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 21:24:25 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Application Environments]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Release Management]]></category>

		<guid isPermaLink="false">http://openmakesoftware.com/mavericks/2009/02/05/running-a-windows-process-as-specified-user/</guid>
		<description><![CDATA[Recently on an assignment I come across a problem that seemingly should have been easy to solve but turned out to be a bit of a stumper. I was trying to execute a remote process using an agent that had to start as a service under the local system account. My requirement was that the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently on an assignment I come across a problem that seemingly should have been easy to solve but turned out to be a bit of a stumper. I was trying to execute a remote process using an agent that had to start as a service under the local system account. My requirement was that the process started by that service had to execute a build using a specific user&#8217;s profile. It was not enough just start the build process as another user, because I needed all of the user&#8217;s environment variables, such as APPDATA and USERPROFILE and its registry settings &#8211; the equivalent of logging in that user. In Unix, I would just &#8217;su&#8217; to the new user and source the profile &#8211; not so easy, as it turned out, on Windows.</p>
<p>After a bit of research I learned about the Windows RunAs program that allows you to do essentially what I needed. The only problem was that it couldn&#8217;t be executed in batch mode since it opened another command prompt to ask for the user&#8217;s password. Looking online, I found some people who had written all sorts of wrapper processes to try to get RunAs to work programatically. This included such circuitous methods as using a VB Script wrapper that detected typed keystrokes to pass them to the password login command prompt. Not a glamorous solution to be sure and not one that I could trust to be reliable for widespread enterprise use. I knew there had to be a Windows API for this &#8211; after some trial and error I finally found the perfect one to do what I wanted and its supposed to be compatible with 2000 &#8211; Vista versions of Windows. It involved using the C# ProcessStartInfo class under the System.Diagnostics package. And, like anytime you find the right tool for the job, once I figured out how to use it, the problem actually became a very quick fix. The class requires five arguments to Start a new process: executable file name, arguments to executable, user name, domain name and password. Note, the password needs to be converted into a  SecureString for PSI to work. For my purposes, I didn&#8217;t want to pass in an encrypted password, so I just converted it in my script.</p>
<p>Here is the critical code snippet to handle command line arguments passed into the Main method.</p>
<p>ProcessStartInfo psi = new ProcessStartInfo();<br />
psi.FileName = args[0];<br />
Console.WriteLine(&#8221;Execution File: &#8221; + args[0]);<br />
psi.Arguments = args[1];<br />
Console.WriteLine(&#8221;Execution Arguments: &#8221; + args[1]);<br />
psi.UseShellExecute = false;<br />
psi.Domain = args[2];<br />
Console.WriteLine(&#8221;Domain: &#8221; + args[2]);<br />
psi.UserName = args[3];<br />
Console.WriteLine(&#8221;User: &#8221; + args[3]);<br />
String pw = args[4];<br />
Char[] pwChars = pw.ToCharArray();<br />
SecureString ss = new SecureString();<br />
foreach (Char pwChar in pwChars)<br />
{<br />
ss.AppendChar(pwChar);<br />
}<br />
psi.Password = ss;<br />
psi.WorkingDirectory = Directory.GetCurrentDirectory(); //start the process in the current working dir<br />
psi.LoadUserProfile = true;<br />
Process p = new Process();<br />
p.StartInfo = psi;<br />
p.Start();</p>
<p>That&#8217;s it! I actually wrapped the Start() method in a try, catch and attempted to login the user name to a local machine account of the same name in cases where the domain login failed in order to handle some machines that were not on the same domain, but you probably won&#8217;t need that. Hope this helps!</p>
<p>Adam</p>
<img src="http://openmakesoftware.com/blogs/adamgabor/wp-content/plugins/pixelstats/trackingpixel.php?post_id=90&amp;ts=1268494264" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://openmakesoftware.com/blogs/adamgabor/2009/02/05/running-a-windows-process-as-specified-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.171 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-13 10:31:04 -->
