<?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>JayFlowers</title>
	<atom:link href="https://www.jayflowers.com/WordPress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://www.jayflowers.com/WordPress</link>
	<description>Bodhisattva in Training</description>
	<lastBuildDate>Tue, 23 Oct 2012 17:35:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.4.2</generator>
	<item>
		<title>DevOps &#8211; The Last Mile &#8211; Workspace Management</title>
		<link>https://www.jayflowers.com/WordPress/?p=270</link>
					<comments>https://www.jayflowers.com/WordPress/?p=270#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Tue, 23 Oct 2012 17:35:47 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=270</guid>

					<description><![CDATA[Here is my presentation from today&#8217;s AgileDC session. Devops – The Last Mile Here are the links to the setup.exe and the GitHub project: https://github.com/jflowers/virgo.sample-greenpages http://jayflowers.com/Misc%20Downloads/Workspace-Setup.exe]]></description>
										<content:encoded><![CDATA[<p>Here is my presentation from today&#8217;s AgileDC session.</p>
<p><a href='http://jayflowers.com/WordPress/wp-content/uploads/2012/10/Devops-–-The-Last-Mile.pptx'>Devops – The Last Mile</a></p>
<p>Here are the links to the setup.exe and the GitHub project:</p>
<p><a href="https://github.com/jflowers/virgo.sample-greenpages" target="_blank">https://github.com/jflowers/virgo.sample-greenpages</a><br />
<a href="http://jayflowers.com/Misc%20Downloads/Workspace-Setup.exe" target="_blank">http://jayflowers.com/Misc%20Downloads/Workspace-Setup.exe</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=270</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Principles, Practices, and Processes</title>
		<link>https://www.jayflowers.com/WordPress/?p=269</link>
					<comments>https://www.jayflowers.com/WordPress/?p=269#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Thu, 16 Aug 2012 18:05:36 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=269</guid>

					<description><![CDATA[I love it when I am reading a book and it brings something I have only had a tacit understanding of to a cognitive understanding.&#160; Apparently I have been running around without truly understanding the difference and relation between principles, &#8230; <a href="https://www.jayflowers.com/WordPress/?p=269">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I love it when I am reading a book and it brings something I have only had a tacit understanding of to a cognitive understanding.&#160; Apparently I have been running around without truly understanding the difference and relation between principles, practices, and processes.&#160; <a href="http://jayflowers.com/WordPress/?p=178">I have understood the definition of principle.</a>&#160; I gained a clear understanding of it from Steven Covey:</p>
<blockquote>
<p>Principles are like lighthouses. They are natural laws that cannot be broken. As Cecil B. deMille observed of the principles contained in his monumental movie, <i>The Ten Commandments,</i> “It is impossible for us to break the law. We can only break ourselves against the law.” — <b>Stephen R. Covey</b>&#160;</p>
</blockquote>
<p><a href="http://www.7freedom.com/naturalprinciples.htm">Principles don’t require our belief</a> for them to work.&#160; I have also understood that practices and processes flow from principles.&#160; What I just recently learned from the <a href="http://books.google.com/books?id=WL4_ag8wfCsC&amp;printsec=frontcover&amp;dq=lean+it&amp;source=bl&amp;ots=AHbkTcpY4_&amp;sig=otm9030MA715dYNDxLMWNAC_gF4&amp;hl=en&amp;sa=X&amp;ei=ZCMtUOLxA6XV0QHuqoHABw&amp;ved=0CDkQ6AEwAA#v=snippet&amp;q=practices&amp;f=false">book Lean IT</a> is about practices and processes.</p>
<blockquote>
<p>…we use the term process to describe a series of actions or operations supported by structured information. Processes are activities that are generally repetitive, well-defined, routine, controllable, and standardized. In contrast, practices are nonroutine, highly variable, loosely defined, and require a degree of judgment and experience to carry out.</p>
</blockquote>
<blockquote>
<p>…information used in practice work is typically unstructured, difficult to define, and often experiential. When improving practices, the focus is on supporting a learning organization through an accessible collection of knowledge of past experiences to enable situation-specific decision making. To support practice work, knowledge management systems should be designed to manage both unstructured data (searchable content, documents, and images) and structured data (information in transactional databases, drilldown reports, trend analyses, etc.). They may also provide access to collaborative social networks, forums, blogs, wikis, and other sources of free-form knowledge sharing. Over time, some of the elements of practice work may be simplified and standardized into processes, effectively creating more efficiency without sacrificing agility.</p>
</blockquote>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[1]" border="0" alt="CropperCapture[1]" align="right" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/08/CropperCapture1.png" width="571" height="431" /></p>
<div style="z-index: 1; position: relative; width: 300px; height: 431px; top: 115px">Why would this be important?&#160; Well, many reasons… For me, most recently, it has been important in trying to help lead a change in our business sector.&#160; I have found that change is most likely to adopted when the parties involved understand the WHY first.&#160; Simon Sinek holds this same view as you can see from the picture of his golden circle and/or from his book: <a href="http://www.audible.com/pd/ref=sr_1_1?asin=B004DJCZUW&amp;qid=1345137483&amp;sr=1-1">Start with Why: How Great Leaders Inspire Everyone to Take Action</a>.&#160; Why maps back to principles and value systems, where as how maps back to practices and processes.</div>
<p><img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CropperCapture[2]" border="0" alt="CropperCapture[2]" align="left" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/08/CropperCapture2.png" width="424" height="295" /></p>
<div style="z-index: 1; position: relative; height: 424px; top: 105px">I have also found these concepts useful in quantifying skill level of personnel.&#160; Those with Wisdom and Understanding are capable of performing practices.&#160; Those with Wisdom are able to define new processes.&#160; Those with Knowledge and Information are able to perform processes.&#160; </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=269</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Switching to Jenkins&#8211;Download and Install Artifact Script for Tester</title>
		<link>https://www.jayflowers.com/WordPress/?p=265</link>
					<comments>https://www.jayflowers.com/WordPress/?p=265#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 15:23:00 +0000</pubDate>
				<category><![CDATA[Continuous Integration]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=265</guid>

					<description><![CDATA[One of the things that I really liked about the version of CCNet that I was using was the ability to publish artifacts for download on the build report web page.&#160; Here is a snapshot of the featured artifacts section &#8230; <a href="https://www.jayflowers.com/WordPress/?p=265">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>One of the things that I really liked about the version of CCNet that I was using was the ability to publish artifacts for download on the build report web page.&#160; Here is a snapshot of the featured artifacts section of the summary report:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image3.png" width="449" height="198" /></p>
<p>Beyond the nice GUI you could count on the url for the artifacts to conform to a pattern.&#160; For example the weblogic release installer exe can be found at this address:</p>
<p>http://cir51-build03/Chapter33-5.2/Artifacts/20120314114423/Chapter33-Weblogic-Release-5.2.1.40468.exe</p>
<p>This enabled me to write a script, Chapter33.Deploy.Release.For.Tester.bat, that would download the http content, database installer, and weblogic installer and install the Chapter33 application in a tester’s private(local) workspace.&#160; Well I am getting a little ahead of myself, the script also read from a CCNet REST interface.&#160; It would gather up the build numbers for the last 6 successful Release Builds and present a GUI to the tester asking them which version of the application they would like to install.</p>
<p>Jenkins offers the analogous features, both artifacts for download and a REST interface, that will enable an analogous script to be written.&#160; First lets look at the REST interface.&#160; You can quickly see the xml from a REST request in you browser by adding /api/xml to any Jenkins page you are on.&#160; So if you were at the following URL(a project dashboard):</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image4.png" width="697" height="173" /></p>
<p>&#160;</p>
<p>Just adding /api/xml to the URL will call the REST interface:</p>
<p>&#160;</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image5.png" width="703" height="329" /></p>
<p>If you want some more info on options for calling the REST API just /api to the URL…&#160; Now the Jenkins xml REST interface is pretty cool in that you can specify the depth of information as well as tune it with an xpath query.&#160; We will need a deeper depth of information as the current depth does not show the result, success or failure, for each build, nor does it give us the build display name.&#160; By adding the query param depth=1 we get:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image6.png" width="723" height="950" /></p>
<p>&#160;</p>
<p>Finally we just need the build number for the last 6 successful build.&#160; Note on my projects where <a href="http://jayflowers.com/WordPress/?p=258">we set the build display name to the SVN revision number</a> we select the fullDisplayName as opposed to the build number here.&#160; By adding the this xpath query xpath=(/*/build[result=&#8217;SUCCESS&#8217;])[position()&lt;=6]/number we get the following results:&#160; </p>
<p>&#160;</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image7.png" width="1051" height="218" /></p>
<p>&#160;</p>
<p>Only 5 results are returned here because there are only 5 successful builds retained on this job.&#160; With this REST query we have enough to get started on a Groovy script to download the artifacts.</p>
<blockquote>
<p>def protocol = &#8216;http://&#8217;      <br />def serverName = &#8216;ci.jruby.org&#8217;       <br />def port = &#8221;       <br />def jobName = &#8216;jruby-dist-release&#8217;       <br />def resultSetSize = 6</p>
<p>def restEndPointBuildList = &quot;${protocol}${serverName}${port}/job/${jobName}/api/xml?depth=1&amp;xpath=(/*/build[result=&#8217;SUCCESS&#8217;])[position()&lt;=${resultSetSize}]/number&amp;wrapper=builds&quot;      <br />def slurper = new XmlSlurper()       <br />def buildList = slurper.parse(restEndPointBuildList)</p>
<p>def goodBuilds = new ArrayList&lt;String&gt;()</p>
<p>buildList.number.each {      <br />&#160;&#160;&#160; goodBuilds.add(it.text())       <br />}</p>
</blockquote>
<p>This code will create an array of the build numbers returned from the REST query.&#160; It uses the XmlSlurper to accomplish this, both downloading the REST result and parsing it so that we can loop over it creating the array of good build numbers.&#160; Next we need to present the user with a UI so that they may choose a build that they wish to download and install.&#160; I did not care about making the UI pretty so I opted to use a basic antforms UI.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image8.png" width="291" height="297" /></p>
<blockquote>
<p>def goodBuildsFlat = &#8221;</p>
<p>goodBuilds.sort().each {      <br />&#160;&#160;&#160; if (goodBuildsFlat == &#8221;){       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; goodBuildsFlat = it       <br />&#160;&#160;&#160; }else{       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; goodBuildsFlat = it + &quot;,&quot; + goodBuildsFlat       <br />&#160;&#160;&#160; }       <br />}</p>
<p>def ant = new AntBuilder()      <br />ant.taskdef(       <br />&#160;&#160;&#160; name:&quot;antform&quot;,       <br />&#160;&#160;&#160; classname: &quot;com.sardak.antform.AntForm&quot;,       <br />&#160;&#160;&#160; classpath: System.getenv(&#8216;ANT_HOME&#8217;) + &quot;/lib/antform.jar&quot;       <br />);</p>
<p>ant.antform(title: &quot;Choose Which Build to Deploy&quot;){      <br />&#160;&#160; ant.label(&quot;Choose a build&quot;)       <br />&#160;&#160;&#160; ant.radioSelectionProperty(label: &quot;Builds: &quot;, property: &quot;buildChosen&quot;, values: &quot;${goodBuildsFlat}&quot;)       <br />}       <br />def buildNumber = ant.project.properties.buildChosen;</p>
</blockquote>
<p>The antforms task will accept a comma separated value string of options to make radio buttons out of.&#160; I wanted them to be sorted, that is first bit of code here.&#160; Next we need to load the antforms task.&#160; You can see here that the jar is loaded from the ant lib dir.&#160; You could load it from anywhere…&#160; After the ant task has been loaded we call to display the form passing in several options like a title and labels.&#160; When the user clicks the OK button the ant property buildChosen will contain the value they chose.&#160; This is placed in the local variable buildNumber.</p>
<blockquote>
<p>def restEndPointBuild = &quot;${protocol}${serverName}${port}/job/${jobName}/api/xml?depth=1&amp;xpath=/*/build[number=&#8217;${buildNumber}&#8217;][1]&quot;</p>
<p>def build = slurper.parse(restEndPointBuild)</p>
<p>build.artifact.each {      <br />&#160;&#160;&#160; def artifactFileName = it.fileName.text()       <br />&#160;&#160;&#160; def artifactRelativePath = it.relativePath.text()       <br />&#160;&#160;&#160; def artifactUrl = &quot;${protocol}${serverName}${port}/job/${jobName}/${buildNumber}/artifact/${artifactRelativePath}&quot;       <br />&#160;&#160;&#160; download(artifactUrl, &quot;C:\\Temp\\${artifactFileName}&quot;)       <br />}</p>
</blockquote>
<p>Next the script makes a REST query getting the build details for the build chosen.&#160; It then loops over the artifacts published in that build downloading each.&#160; This is the part of the script that you will need to start tailoring to your needs.&#160; Where do you want to download to?&#160; Do you want to download all the artifacts or just a specified few?&#160; What are you going to do after downloading the artifacts?&#160; On the project that I am working on at the moment we publish full on headless installers.&#160; After downloading these installers we execute them.&#160; This provides a push button script for the testers or anyone on the project to deploy a personal instance of the application any time they wish.&#160; They even get to choose the version they want to install.</p>
<p>&#160;</p>
<p>Ooh before I forget here is the last bit of the script, the download method.&#160; I used Curl so that if the download fails it will pick back up where it left off we you retry.&#160; This assumes that Curl is in your PATH.</p>
<blockquote>
<p>def download(url, destination){      <br />&#160;&#160;&#160; String command = &quot;-0 -m 86400 -S -C &#8211; -o \&quot;${destination}\&quot; -k -L &#8211;retry 5 ${url}&quot;</p>
<p>&#160;&#160;&#160; def ant = new AntBuilder()      <br />&#160;&#160;&#160; ant.exec(executable: &quot;curl&quot;){       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; arg(line: &quot;${command}&quot;)       <br />&#160;&#160;&#160; }       <br />}</p>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=265</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Switching to Jenkins&#8211;SVN Revision Number as the Build Number</title>
		<link>https://www.jayflowers.com/WordPress/?p=258</link>
					<comments>https://www.jayflowers.com/WordPress/?p=258#comments</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Thu, 15 Mar 2012 16:57:34 +0000</pubDate>
				<category><![CDATA[Continuous Integration]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=258</guid>

					<description><![CDATA[One of the things that I really liked about the version of CCNet that I was using was the custom build labeller we were using.&#160; It would append to a base string the SVN revision number.&#160; Here is a snapshot &#8230; <a href="https://www.jayflowers.com/WordPress/?p=258">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>One of the things that I really liked about the version of CCNet that I was using was the custom build labeller we were using.&#160; It would append to a base string the SVN revision number.&#160; Here is a snapshot of the Recent Builds widget on one of our Release Build reports:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image.png" width="182" height="377" /></p>
<p>This build server was working on the 5.2.1 branch and the most recent build was of SVN revision 40468.&#160; This allows developer to easily communicate what build their changes or fixes are in.&#160; So for example a tester can easily understand which build they want to download, install, and test…&#160; That is very convenient, yes?</p>
<p>Jenkins does not have this feature.&#160; In all fairness neither did CCNet, we had to write a plugin.&#160; In this case I found a Groovy plugin for Jenkins that I used to script up a solution.&#160; The documentation for the plugin can be found <a href="https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin">here</a>.</p>
<p>I made the first build step a system Groovy step and added the following code:</p>
<p><a href="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image_thumb.png" width="464" height="409" /></a></p>
<p>Executing as a system Groovy step means this will be executed in the same JVM as Jenkins, allowing access to all the Jenkins objects…so we can alter the build display name.&#160; The first two lines are importing the Jenkins(Hudson) packages.&#160; The javadocs for what is available are located <a href="http://javadoc.jenkins-ci.org/">here</a>.</p>
<blockquote>
<p>import hudson.model.*      <br />import hudson.util.*</p>
</blockquote>
<p>The next line is a neat little trick that will give you a reference to the current build.</p>
<blockquote>
<p>def build = Thread.currentThread().executable</p>
</blockquote>
<p>We will first use this build object to get the workspace folder path.&#160; This is where the build is executing out of.&#160; We need this piece of information so that we can execute the subversion command “info” in the root of the workspace.</p>
<blockquote>
<p>def workspace = build.getWorkspace()</p>
</blockquote>
<p>In Groovy if you want to specify the directory from which to execute a shell command and you want to capture the command’s output the easiest way to use the Ant task exec like so:</p>
<blockquote>
<p>def ant = new AntBuilder()      <br />ant.exec(executable: &quot;svn&quot;, outputproperty: &quot;output&quot;, dir: workspace){       <br />&#160;&#160;&#160; arg(line: &quot;info&quot;)       <br />}</p>
<p>svnInfo = ant.project.getProperty(&quot;output&quot;)</p>
</blockquote>
<p>That captured the out of the svn “info” command into the variable svnInfo.&#160; Now we can use a regular expression to extract the revision we are currently on.&#160; Here is some example output from an svn “info” command:</p>
<blockquote>
<p>C:\Projects\Chapter33\Trunk\Build&gt;svn info      <br />Path: .       <br />URL: <a href="https://va33-repo01/svn/Chapter33/Trunk/Build">https://va33-repo01/svn/Chapter33/Trunk/Build</a>       <br />Repository Root: <a href="https://va33-repo01/svn/Chapter33">https://va33-repo01/svn/Chapter33</a>       <br />Repository UUID: f1ce2e10-74e2-f14b-9613-4d7166fa18d4       <br />Revision: 40498       <br />Node Kind: directory       <br />Schedule: normal       <br />Last Changed Author: bassettt       <br />Last Changed Rev: 40484       <br />Last Changed Date: 2012-03-14 16:24:37 -0400 (Wed, 14 Mar 2012)</p>
</blockquote>
<p>We want to extract from all that the Last Changed Rev value, and we can do that with this code:</p>
<blockquote>
<p>def pattern = /Last\s+Changed\s+Rev:\s+(\d+)/      <br />def matcher = (svnInfo =~ pattern)</p>
<p>def buildLabel = &#8216;Dev-&#8216; + matcher[0][1]      </p>
</blockquote>
<p>We take the extracted value, in this example 40484, and set a variable named buildLabel to “Dev-40484”.&#160; Lastly we set the Jenkins build display name.</p>
<blockquote>
<p>println &#8216;setting build label for this build&#8217;</p>
<p>build.setDisplayName(buildLabel)</p>
</blockquote>
<p>This results in a Build History widget that looks like this:</p>
<p><a href="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/image_thumb1.png" width="338" height="321" /></a></p>
<p>&#160;</p>
<p>If you are familiar with Jenkins you might ask why not just use the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin">Build Name Setter Plugin</a>?&#160; I would have but the svn env var Jenkins sets is often incorrect as documented <a href="http://jenkins.361315.n4.nabble.com/SVN-REVISION-not-showing-the-correct-revision-td4041539.html">here</a>(I too see this bug).&#160; So I wrote my own solution…&#160; I also use variations on this to show versions of the application as the move through the build pipeline.&#160; Instead of grabbing the build name from subversion in downstream builds I grab it from the triggering upstream build.&#160; There are lots of interesting uses for this.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=258</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Continuous Integration Principles&#8211;Shared Read/Write Servers are Bad</title>
		<link>https://www.jayflowers.com/WordPress/?p=252</link>
					<comments>https://www.jayflowers.com/WordPress/?p=252#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sun, 11 Mar 2012 20:26:18 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=252</guid>

					<description><![CDATA[At the beginning of most projects that I have been on the default starting position has been that dev and test will each get their own environment to share.&#160; Developers share the dev env and testers share the test env.&#160; &#8230; <a href="https://www.jayflowers.com/WordPress/?p=252">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>At the beginning of most projects that I have been on the default starting position has been that dev and test will each get their own environment to share.&#160; Developers share the dev env and testers share the test env.&#160; I think we need to change this.&#160; Shared environments are good for only a select set of scenarios and development and testing are not among them.</p>
<p><a href="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/tug-o-war.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 3px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="tug-o-war" border="0" alt="tug-o-war" align="right" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/tug-o-war_thumb.png" width="240" height="135" /></a>If they have been the norm what has changed to allow us to go a different route?&#160; Two things: first increased performance of workstations and laptops and second improved automation in the dev/test workspace.&#160; Increased performance in hardware has allowed us to run more servers in a local workspace.&#160; On my laptop I can easily run several Weblogic servers and an Oracle Database with resources left for an IDE and other dev/test tools. Not so long ago this was impossible.&#160; Managing all my servers, the applications running on them, and one or more databases would leave little time to do anything else in a fast changing development project.&#160; Automation alleviates this time sink.&#160; Providing push button headless automation to setup, deploy, and manage these servers is key.&#160; This too was thought of as impossible not to long ago, yet fully automated deployments are more and more common these days.</p>
<p>Okay, so maybe it is possible you say.&#160; Why would I want to do this?&#160; Haven’t shared environments been working&#8230;</p>
<p>No, I don’t think they have been working.&#160; The whole purpose behind this change is to enable developers and testers to test the application more easily, spend less time identifying and recovering from collisions, and for developers specifically to spend less time chasing the version of the shared env.&#160; When several people share an environment they can easily collide with each other.&#160; There are many types of collision, they depend on the architecture of the application under test as well as it’s dependencies.&#160; Many of these types of collision revolve around data.&#160; There are schemes to minimize data collisions, yet no scheme is foolproof.&#160; If every developer and tester has a private environment to work in several things become possible:</p>
<ul>
<li>testers and developers can easily roll back to any version of the application to replicate a bug, or return to last working version </li>
<li>testers and developers can execute automated tests at will, or any kind of test for that matter, no more collisions due to data, execution resources, etc&#8230; </li>
<li>no one is forced to update to a new version of the application, in shared envs updates are normally done nightly, for example a developer could work uninterrupted on a bug through one day and into the next, i.e. no more chasing the shared env version&#8230; </li>
</ul>
<p>All of these things will dramatically increase the productivity of a team!</p>
<p>At this point you may think that I am claiming that a whole environment should be hosted locally on a developer/tester workspace.&#160; I am not.&#160; I only think that all read/write servers should be local.&#160; Readonly servers could, most of the time should, be shared.&#160; Remember that what counts is how you interact with the server.&#160; If your application only ever reads from it then you should treat it as a readonly server.</p>
<p>If you search around the internet on this subject you will mostly find that this subject has been written on from the database point of view.&#160; Here are a few good examples:</p>
<ul>
<li><a href="http://www.troyhunt.com/2011/02/unnecessary-evil-of-shared-development.html">The unnecessary evil of the shared development database</a> </li>
<li><a href="http://blog.daemon.com.au/go/blog-post/working-on-a-shared-development-server-is-bad">Working on a Shared Development Server is Bad</a> </li>
<li><a href="http://www.benday.com/2011/01/25/top-4-reasons-why-a-shared-development-database-is-evil/">Top 4 Reasons Why a Shared Development Database is Evil.</a> </li>
</ul>
<p>Most of the issues that have been documented around shared database servers effect shared webservices, EJBs, .Net Remoting, REST, etc…</p>
<p>Just in case you are not yet convince let’s try some systems thinking.&#160; This situation of shared servers or resources indicates that we should take a look at the archetype “Tragedy of the Commons”.&#160; This is taken from the site <a href="http://www.systems-thinking.org">http://www.systems-thinking.org</a>:</p>
<p>&#160;</p>
<blockquote>
<h3>
<p>Tragedy of the Commons</p>
</h3>
<p>The Tragedy of the Commons structure represents a situation where, to produce growth, two or more <a href="http://www.systems-thinking.org/theWay/sre/re.htm">Reinforcing Loops</a> are dependent on the availability of some common limited resource.</p>
<p><img align="bottom" src="http://www.systems-thinking.org/theWay/stc/tc.gif" width="250" height="271" /></p>
<p><b>A&#8217;s activity</b> interacts with the <b>resources available</b> adding to <b>A&#8217;s results</b>. <b>A&#8217;s results</b> simply encourage more of <b>A&#8217;s activity</b>. The same sequence plays out for <b>B&#8217;s activity</b>. And, the more resources used the greater the results. This simply encourages A and B to use more resources.</p>
<p><b>A&#8217;s activity</b> and <b>B&#8217;s activity</b> combine to produce some <b>total activity</b>. This <b>total activity</b> subtracts from the <b>resources available</b>. The extent of the resources available being defined by the <b>resource limit</b>.</p>
<p><b>Total activity</b> continues until it completely depletes the <b>resources available</b>. When this happens <b>A&#8217;s results</b> and <b>B&#8217;s results</b> stop growing as there are no more resources to use. What makes this structure even worse is that whoever figures out the structure first, A or B, wins because they use all the resources before the other has a chance to. This structure is often referred to as &quot;All for one and none for all.&quot;</p>
<h5>Managing the Structure</h5>
<p>This structure repeatedly appears in organizational contexts where a service organization supports the success of multiple departments who fail to support the service organization in return. There are two strategies for dealing with this structure, one more effective than the other.</p>
<ul>
<li>The most effective strategy for dealing with this structure is to wire in feedback paths from <b>A&#8217;s results</b> and <b>B&#8217;s results</b> to the <b>resource limit</b> so as A and B use resources their results promotes the availability of additional resources.</li>
<li>The alternate, and less effective, strategy for dealing with this structure is to add an additional resource to control the use of resources by A and B. This strategy limits the overall potential results of the structure to the predefine resource limit. It also adds additional resource to the equation, and probably results in endless disputes as to the fairness associate with the allocation of resources. While not really the most appropriate strategy this is the one most often used &#8212; out of ignorance I would suspect.</li>
</ul>
<h5>Examples</h5>
<ul>
<li><a href="http://www.systems-thinking.org/theWay/stc/tcx01.htm">If It&#8217;s Free I Want All I Can Get</a></li>
<li><a href="http://www.systems-thinking.org/theWay/stc/tcx02.htm">When Fair is Unfair</a></li>
</ul>
</blockquote>
<p>In our case the resource can be replenished in a couple of ways depending on how it was or is being depleted.&#160; A scorch and rebuild of the data will replenish a data depletion.&#160; If the server resources, CPU, memory, IO, etc… where depleted then simply curtailing the over usage will replenish the server.&#160; I find this site’s offered solutions lacking.&#160; It’s presentation is as if it is a syllogism.&#160; An easy third solution is to dedicate a resource per user.&#160; This removes some of the limiting factor from the system and all of the shared aspect leaving a set of independent reinforcing loops, one per user.&#160; I this case both A and B get their own resource.&#160; </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=252</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Congressional Testimony of Government Success with Agile</title>
		<link>https://www.jayflowers.com/WordPress/?p=249</link>
					<comments>https://www.jayflowers.com/WordPress/?p=249#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sun, 11 Mar 2012 18:11:18 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=249</guid>

					<description><![CDATA[The following are snippets from the link below: http://veterans.house.gov/prepared-statement/prepared-statement-hon-roger-w-baker-assistant-secretary-information-and Witness Testimony of Hon. Roger W. Baker, Assistant Secretary for Information and Technology and Chief Information Officer, U.S. Department of Veterans Affairs &#160; Hearing on 03/11/2012: &#160; Introduction Chairman Johnson, Ranking &#8230; <a href="https://www.jayflowers.com/WordPress/?p=249">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>The following are snippets from the link below:</p>
<p><a href="http://veterans.house.gov/prepared-statement/prepared-statement-hon-roger-w-baker-assistant-secretary-information-and">http://veterans.house.gov/prepared-statement/prepared-statement-hon-roger-w-baker-assistant-secretary-information-and</a></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="capital" border="0" alt="capital" align="right" src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/capital.png" width="181" height="240" /></p>
<blockquote>
<h3>Witness Testimony of Hon. Roger W. Baker, Assistant Secretary for Information and Technology and Chief Information Officer, U.S. Department of Veterans Affairs</h3>
<p>&#160;</p>
<p><a href="http://veterans.house.gov/node/">Hearing on 03/11/2012:</a></p>
<p>&#160;</p>
<p><b><u>Introduction</u></b></p>
<p>Chairman Johnson, Ranking Member Donnelly, members of the Subcommittee: thank you for inviting me to testify regarding the Department of Veterans Affairs’ (VA) Information Technology (IT) strategy for the 21st century.&#160; I appreciate the opportunity to discuss VA’s plans, actions, and accomplishments that will position VA’s IT organization as a 21st century leader in the Federal Government.</p>
</blockquote>
<p>&#160;</p>
<blockquote>
<ol>
<li><b>Product Delivery</b> </li>
</ol>
<p>IT is an enabler to the implementation of the Secretary’s 16 Transformational Initiatives, which cannot be executed without newly developed IT products.&#160; These initiatives are key to improving VA’s services to Veterans, and IT investments have allowed us to deliver products or plan for on-time delivery of the following programs:</p>
<ul>
<li><i>Successful, on-time delivery of the critical G.I. Bill project</i>. VA successfully converted all processing of new Post-9/11 GI Bill claims to the Long Term Solution (LTS) prior to the commencement of the Fall 2010 enrollment process.&#160; Since installation, processing with the new system has been excellent, with no significant “bugs” encountered.&#160; The Veterans Benefits Administration claims processors like the new system and find it easier and more efficient to use.&#160; By dramatically changing its development processes, adopting the Agile methodology for this project, VA also dramatically changed its system development results;<b> </b></li>
</ul>
</blockquote>
<p><u><font style="background-color: #ebeef1"></font></u></p>
<blockquote>
<p><b>Agile development</b></p>
<p>A primary driver of our success under PMAS has been the adoption of incremental development.&#160; Every project at VA, without exception, must deliver functionality to its users at least every six months.&#160; Several of our most important projects, including the GI Bill and VBMS, have adopted Agile development methodologies. Whereas PMAS addresses the planning and management aspects of short, incremental delivery, the Agile development methodology provides the technical management guidance of how to turn project requirements into working software quickly and in collaboration with the customer.&#160;&#160; </p>
<p>Agile development is important to the VA because it encourages continuous input from our customers.&#160; In agile projects, all the development priorities are set by the customer, which ensures that the work is performed in the order of importance.&#160; To increase the likelihood of success, large projects are broken down into small but valuable increments, each of which could potentially be a candidate for release.&#160; This is consistent with our PMAS delivery requirements.&#160; Lastly, agile development requires continuous quality assurance throughout the entire development effort, further ensuring high quality deliverables.</p>
<p>Agile software development methodologies are an effective means of improving the predictability, quality, and transparency of software products and their development. At the core of Agile is the iterative work process. Business problems are broken down into small increments of delivery that are tangible products that can be reviewed and verified regularly by business stakeholders. By constantly incorporating feedback, the software that is essential to solving the business problem is created in partnership with stakeholders and any miscommunications, revisions, or changes in business needs can be accommodated quickly and with little rework. The quality of software is kept high throughout the development process as the product in development is kept as close to a production-ready state as possible with each release increment. In addition, prior to the start of each increment, business stakeholders and the development team agree upon which features or requirements are to be satisfied during that increment thus ensuring that the most important work is completed first.</p>
<p>Contrary to popular belief, the successful Agile program requires great rigor as it is essentially a process based on statistical analysis. Every work product (software or otherwise) is defined, broken down and estimated. As work progresses, these work products are carefully tracked on a daily basis and results of progress are published to the team and stakeholders (and any other authorized, interested party) to provide complete transparency. The result of this hyper-transparency is that problems in the development process are identified early and changes, regardless of their origin, can be accommodated quickly and efficiently.</p>
</blockquote>
<p>I am honored to work on this project.&#160; We have accomplished a significant number of releases in the course of the project.&#160; I am proud to say the we truly are practicing Agile.&#160; This is the first project where I have gotten to implement automated deployments all the way to production!&#160; I hope the next project I work on is as rewarding as this one is.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=249</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Continuous Integration Practices&#8211;Precommit Process</title>
		<link>https://www.jayflowers.com/WordPress/?p=232</link>
					<comments>https://www.jayflowers.com/WordPress/?p=232#comments</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sat, 03 Mar 2012 21:42:30 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=232</guid>

					<description><![CDATA[Often what gets all the attention in Continuous Integration is what happens on a continuous integration server.&#160; There is more to CI than what happens on the server.&#160; What happens on a developer workspace is part of CI as well.&#160; &#8230; <a href="https://www.jayflowers.com/WordPress/?p=232">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Often what gets all the attention in Continuous Integration is what happens on a continuous integration server.&#160; There is more to CI than what happens on the server.&#160; What happens on a developer workspace is part of CI as well.&#160; An easy example of this is the precommit process.&#160; It describes what a developer does before committing changes to source control.</p>
<p> <img src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/clipboard.jpg" border="0" alt="" title="clipboard.jpg" width="240" height="240" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /> </p>
<p>On a simple and small project this would entail:</p>
<ol>
<li>Update to the latest source </li>
<li>Recompile (a clean compile) </li>
<li>Run all the tests (may require a local deployment) </li>
</ol>
<p>The larger and more complex the project gets the less tenable this procedure becomes.&#160; When you end up with thousands of unit tests, thousands of integration tests, and hundreds of user acceptance tests, functional tests, etc… it becomes unreasonable to run all of them every time before you commit.&#160; To run all these tests would take a long time.&#160; So how long is acceptable you say?&#160; You need to decide that for yourself.&#160; The project I am working on as I write this has decided that the whole precommit process should take about 30 minutes.&#160; That doesn’t mean that we throw away tests until we can complete the process in the allotted time.&#160; We need to take educated guesses as to which tests we should run, which tests are most relevant to the changes that are being tested.&#160; For example if I was making changes to how the system processes orders there would be no value in running tests on product comparison.</p>
<p>In the book “<font face="Verdana">Software Configuration Management Patterns: Effective Teamwork, Practical Integration” the pattern </font>Private Build System is basically the same thing:</p>
<blockquote>
<h4>Context</h4>
<p>A Private Workspace allows you, as a developer, to insulate yourself from external changes to your environment. But your changes need to work with the rest of the system too. To verify this, you need to build the system consistently, including building with your changes. This pattern explains how you can check whether your code will still be consistent with the latest published code base when you submit your changes.</p>
<h4><a name="PrivateBuildSystemPatlet-Problem"></a>Problem</h4>
<p>How do you verify that your changes do not break the build or the system before you check them in?</p>
<h4><a name="PrivateBuildSystemPatlet-Solution"></a>Solution</h4>
<p>Before making a submission to source control, build the system using a Private System Build similar to the nightly build.</p>
</blockquote>
<p>This patlet raises the why of it: <strong>why do we need a precommit process?</strong>&#160; And just like it says to make sure that we do not break the codeline (i.e. trunk or a branch).</p>
<p><strong>Why don’t we want to break the codeline(build)?</strong> So that we don’t negatively affect the rest of the team.</p>
<p><strong>How would breaking the codeline(build) negatively affect the rest of the team?</strong>&#160; In two ways; first it would prevent anyone else from committing to the build as we follow the rule of not committing on top of a broken build, two if anyone updates from source control their local build will be broken too.</p>
<p><strong>Why is blocking the build a bad thing?</strong>&#160; It is not so bad if you fix the build quickly.&#160; It really only becomes a bad thing when it is broken for an extended period of time.&#160; This prevents others from committing to the build and so they continue to work, increasing the size of their changeset.&#160; Large change sets are more likely to break the build, and when they do break the build they usually take a long time to fix.&#160; This can easily lead to a situation where the build is often broken for extended periods of time.</p>
<p><strong>Why is having the build broken for extended periods of time or all the time a bad thing?</strong>&#160; The build then looses it usefulness.&#160; It is clearly no longer keeping the codeline stable, which is its purpose.</p>
<p>Those 5 whys get us to the root of it.&#160; We need a precommit process to support a centralized build process.&#160; They also paint a picture that many feel is a slippery slope, causing great fear of breaking the build.&#160; The danger is in how long you let any given broken build remain broken.&#160; As long as you fix the build quickly, or rollback the offending changes to last good build quickly there is no danger.</p>
<h2>Fear of Broken Builds</h2>
<p>Fear of breaking the build has caused some people to adopt measures to keep the build green at all costs.&#160; There are several commercial CI Servers that play into this fear with features that provide precommit isolated private builds.&#160; These are builds that occur outside of the developer’s workspace, they are private in the sense that the results are only shown to the developer who submitted the changes and the changes don’t make there way into source control unless the build passes.&#160; Another common measure is to insist that all tests are run as a part of the precommit process.&#160; Both of these have the side effect of increasing the average size of a changeset committed to the build.&#160; Granted that these large changesets will pass the build…they will not necessarily be easy to integration into each developer’s workspace.&#160; The larger the changeset the greater the chance it will impact changes in a developer’s workspace, especially if the local changes are large as well.&#160; Gradual changes over time are easier to integration into a developer’s workspace than big bang changes.&#160; A significant compounding factor with big bang changes is that they tend to be committed at the end of an iteration.&#160; This means you would likely have multiple developers competing to commit large changesets at the end of an iteration.&#160; When the competition gets rough developers often rationalize breaking the build in favor of being able to commit their changes hoping to differ testing to the next iteration. We finished the story, except for the testing, we’ll test it next iteration.</p>
<p>  <img src="http://jayflowers.com/WordPress/wp-content/uploads/2012/03/iStock_000007510607XSmall.jpg" border="0"  alt="" title="three gear" width="422" height="284" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></p>
<h2>Working in Small Changes</h2>
<p>If the team works by decomposing stories into small tasks, tasks that can be completed in less than a day, preferably a couple of hours, things can work very smoothly.&#160; Imagine that every hour or two the developers are committing changes as they complete tasks.&#160; Their precommit process would involve integration of a small number of changes from a source control update and executing a small number of tests to exercise their changes.&#160; I am sure you can see how this would result in a short precommit process with little chance that the updates from source control would impact local changes.</p>
<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=232</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Continuous Integration Principles–Task Size Rules</title>
		<link>https://www.jayflowers.com/WordPress/?p=222</link>
					<comments>https://www.jayflowers.com/WordPress/?p=222#comments</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sun, 23 Oct 2011 22:27:42 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=222</guid>

					<description><![CDATA[Principles are those kinda things that you don’t have to believe in for them to exist.&#160; For that matter they will still push you around without your consent.&#160; I have never seen a set of Continuous Integration (CI) principles so &#8230; <a href="https://www.jayflowers.com/WordPress/?p=222">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Principles are those kinda things that you don’t have to believe in for them to exist.&#160; For that matter they will still push you around without your consent.&#160; I have never seen a set of Continuous Integration (CI) principles so I thought that I could share the ones that I have found through out my career.&#160; The first one I elect to share is on task size…</p>
<p>&#160;</p>
<p>Below is a loop diagram that shows some of the forces and effects task size can exert on CI.&#160; If you have never seen a loop diagram before you can read this diagram by ideas relating to each other either in the <strong>s</strong>ame way or in the <strong>o</strong>ppisite way.</p>
<p><img src="http://jayflowers.com/WordPress/wp-content/uploads/2011/10/tasksrule1.jpg" alt="" title="tasksrule" width="983" height="604" class="alignnone size-full wp-image-227" /></p>
<p>As task size increases changeset size will increase as well.&#160; People tend to commit changes when they have completed a task.</p>
<p>As changeset size increases so does the average time to fix a build.&#160; When a build breaks and the changeset size was small it is generally easy to know what went wrong and fix it.&#160; If the changeset size was large there are more things to suspect, investigate, and debug.&#160; This takes longer.</p>
<p>As the average time to fix a broken build increases the build availability decreases.&#160; This is assuming that you don’t allow committing changes to a broken build…the more often you have hard to fix builds the less available the build will be.</p>
<p>As the build is less available the changeset size will increase.&#160; This is because developers will continue working while the build is not available, thus increasing the size of their changesets.</p>
<p>As changeset size increases the build stability will decrease. This is because the build breaks more often with large changesets than small changesets.</p>
<p>As build stability decreases the development environment tractability will decrease.&#160; It is more difficult to work on a codeline that is unstable than a stable codeline.</p>
<p>As the environment tractability decreases the rate of change to the codeline will decrease.&#160; Again it is more difficult to work on an unstable codebase.</p>
<p>As the rate of change decreases there will be less broken builds.&#160; If you have a high rate of change you will have more broken builds.</p>
<p>As the number of broken builds increases the build availability will decrease. </p>
<p>&#160;</p>
<p>I don’t mean to show this loop diagram as a standalone or complete system.&#160; There are other forces that can come into play here to address the number of build breaks, how long it takes to fix a broken build, or even isolating build breaks.&#160; These are important.&#160; But they are not the core system.&#160; This is the core system and the root input affecting the system’s output is the size of tasks.&#160; If people are working with small tasks they will break the build far less often and when they do it will be easy to fix.&#160; If people are working with large tasks they will break the build often and when they do it will be difficult to fix.&#160; From what I have seen it works best when one or more small tasks can be completed in a day.&#160; You will need to figure out what works on your project.&#160; </p>
<p>You can also add to this diagram mitigating forces such as a precommit developer build to help control the number of broken builds.</p>
<p>P.S. If you are having a hard time getting task sizes down maybe you should draw a loop diagram of the forces at play keeping task sizes large on your project.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=222</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>AgileDC 2011</title>
		<link>https://www.jayflowers.com/WordPress/?p=217</link>
					<comments>https://www.jayflowers.com/WordPress/?p=217#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sun, 23 Oct 2011 21:05:55 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=217</guid>

					<description><![CDATA[I will be speaking at AgileDC this week on agile testing on government contracts. I have not been to this even before but it look like it will be fun with all the great speaks showing up.&#160; I did not &#8230; <a href="https://www.jayflowers.com/WordPress/?p=217">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I will be speaking at AgileDC this week<img style="display: inline; float: right" title="AgileDC-logo" alt="AgileDC-logo" align="right" src="http://jayflowers.com/WordPress/wp-content/uploads/2011/10/AgileDC-logo.png" width="240" height="192" /> on agile testing on government contracts. I have not been to this even before but it look like it will be fun with all the great speaks showing up.&#160; I did not see where my slide have ben posted on the agiledc.org site so I will link them in <a href="http://jayflowers.com/Misc Downloads/Agile Testing.pptx">here</a>.&#160; Hope to see you there.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=217</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Demanding of Ant: 2 Run Once</title>
		<link>https://www.jayflowers.com/WordPress/?p=214</link>
					<comments>https://www.jayflowers.com/WordPress/?p=214#respond</comments>
		
		<dc:creator><![CDATA[jflowers]]></dc:creator>
		<pubDate>Sun, 02 May 2010 02:23:57 +0000</pubDate>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<guid isPermaLink="false">http://jayflowers.com/WordPress/?p=214</guid>

					<description><![CDATA[The use of the depends attribute on targets is prevalent in many project Ant scripts.  I believe that depends is the bane of reuse.  Lets take the name of a simple target like deploy.  In the context of a developers &#8230; <a href="https://www.jayflowers.com/WordPress/?p=214">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>The use of the depends attribute on targets is prevalent in many project Ant scripts.  I believe that depends is the bane of reuse.  Lets take the name of a simple target like deploy.  In the context of a developers environment deploy would likely depend on package, package on unittest, unittest on compile…  This is fine until you want to reuse deploy in a different context, say to a different environment like production.  In that context deploy has no business with such a dependency chain.</p>
<p>That is not a clear enough picture though.  Depends is not just for defining a dependency chain, it also includes the much desired feature of run once.  That is to say when I call the target deploy, compile will only been run once even though both recompile and unittest depend on it.</p>
<div style="font-family: courier new; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&#8220;<span style="color: blue">1.0</span>&#8220;<span style="color: blue"> </span><span style="color: red">encoding</span><span style="color: blue">=</span>&#8220;<span style="color: blue">UTF-8</span>&#8220;<span style="color: blue">?&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">project</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">scratch</span>&#8220;<span style="color: blue"> </span><span style="color: red">default</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue"> </span><span style="color: red">basedir</span><span style="color: blue">=</span>&#8220;<span style="color: blue">.</span>&#8220;<span style="color: blue"> &gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue"> </span><span style="color: red">depends</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile,package</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>deploy the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">package</span>&#8220;<span style="color: blue"> </span><span style="color: red">depends</span><span style="color: blue">=</span>&#8220;<span style="color: blue">unittest</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>package the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">unittest</span>&#8220;<span style="color: blue"> </span><span style="color: red">depends</span><span style="color: blue">=</span>&#8220;<span style="color: blue">compile</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>test the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">compile</span>&#8220;<span style="color: blue"> &gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>compile the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">clean</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>clean missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile</span>&#8220;<span style="color: blue"> </span><span style="color: red">depends</span><span style="color: blue">=</span>&#8220;<span style="color: blue">clean,compile</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">project</span><span style="color: blue">&gt;</span></p>
</div>
<p>The output from calling the target deploy would be:</p>
<blockquote><p><font face="Consolas" color="#004080">c:\&gt;ant -f scratch.build.xml<br />
Buildfile: scratch.build.xml </font></p>
<p><font face="Consolas" color="#004080">clean:<br />
[echo] clean missile </font></p>
<p><font face="Consolas" color="#004080">compile:<br />
[echo] compile the missile </font></p>
<p><font face="Consolas" color="#004080">recompile: </font></p>
<p><font face="Consolas" color="#004080">unittest:<br />
[echo] test the missile </font></p>
<p><font face="Consolas" color="#004080">package:<br />
[echo] package the missile </font></p>
<p><font face="Consolas" color="#004080">deploy:<br />
[echo] deploy the missile </font></p>
<p><font face="Consolas" color="#004080">BUILD SUCCESSFUL<br />
Total time: 0 seconds</font></p></blockquote>
<p>Sidenote: you should almost never use antcall.  It violates the principle of least astonishment.  You should think of it like you are ask for Ant to execute the target in isolation.  You should use runtarget from Ant contrib.</p>
<p>I have found the use of orchestration targets to be far more powerful when I can ask for a target to be executed and optionally specify that it only be run once.  The depends run once is not as robust as you might think.  If you call multiple targets from the command line run once does not always work:</p>
<blockquote><p><font face="Consolas" color="#004080">c:\&gt;ant -f scratch.build.xml recompile unittest<br />
Buildfile: scratch.build.xml </font></p>
<p><font face="Consolas" color="#004080">clean:<br />
[echo] clean missile </font></p>
<p><font face="Consolas" color="#004080"><font color="#ff0000">compile</font>:<br />
[echo] compile the missile </font></p>
<p><font face="Consolas" color="#004080">recompile: </font></p>
<p><font face="Consolas" color="#004080"><font color="#ff0000">compile</font>:<br />
[echo] compile the missile </font></p>
<p><font face="Consolas" color="#004080">unittest:<br />
[echo] test the missile </font></p>
<p><font face="Consolas" color="#004080">BUILD SUCCESSFUL<br />
Total time: 0 seconds</font></p></blockquote>
<p>What would be ideal would be the following.</p>
<div style="font-family: courier new; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">package</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>deploy the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">package</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">unittest</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>package the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">unittest</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">compile</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>test the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">compile</span>&#8220;<span style="color: blue"> &gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>compile the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">clean</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>clean missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">clean</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">compile</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
</div>
<p>With the output:</p>
<blockquote><p><font face="Consolas" color="#004080">c:\&gt;ant -f scratch.build.xml recompile unittest<br />
Buildfile: scratch.build.xml </font></p>
<p><font face="Consolas" color="#004080">recompile: </font></p>
<p><font face="Consolas" color="#004080">clean:<br />
[echo] clean missile </font></p>
<p><font face="Consolas" color="#004080">compile:<br />
[echo] compile the missile </font></p>
<p><font face="Consolas" color="#004080">unittest:<br />
[echo] test the missile </font></p>
<p><font face="Consolas" color="#004080">BUILD SUCCESSFUL<br />
Total time: 0 seconds</font></p></blockquote>
<p>I implemented the call task with a macrodef that checks if the target has been run; this is tracked by checking the existence of a property.</p>
<div style="font-family: courier new; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">macrodef</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">call</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">attribute</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">target</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">attribute</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">if</span>&#8220;<span style="color: blue"> </span><span style="color: red">default</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">attribute</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">unless</span>&#8220;<span style="color: blue"> </span><span style="color: red">default</span><span style="color: blue">=</span>&#8220;<span style="color: blue">false</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">attribute</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">once</span>&#8220;<span style="color: blue"> </span><span style="color: red">default</span><span style="color: blue">=</span>&#8220;<span style="color: blue">false</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">sequential</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">if</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">      &lt;</span><span style="color: #a31515">and</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">        &lt;</span><span style="color: #a31515">istrue</span><span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&#8220;<span style="color: blue">@{if}</span>&#8220;<span style="color: blue"> /&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">        &lt;</span><span style="color: #a31515">isfalse</span><span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&#8220;<span style="color: blue">@{unless}</span>&#8220;<span style="color: blue"> /&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">        &lt;</span><span style="color: #a31515">or</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">          &lt;</span><span style="color: #a31515">and</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">            &lt;</span><span style="color: #a31515">istrue</span><span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&#8220;<span style="color: blue">@{once}</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">            &lt;</span><span style="color: #a31515">not</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">              &lt;</span><span style="color: #a31515">isset</span><span style="color: blue"> </span><span style="color: red">property</span><span style="color: blue">=</span>&#8220;<span style="color: blue">${ant.project.name}.Target.@{target}.Executed</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">            &lt;/</span><span style="color: #a31515">not</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">          &lt;/</span><span style="color: #a31515">and</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">          &lt;</span><span style="color: #a31515">isfalse</span><span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&#8220;<span style="color: blue">@{once}</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">        &lt;/</span><span style="color: #a31515">or</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">      &lt;/</span><span style="color: #a31515">and</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">      &lt;</span><span style="color: #a31515">then</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">        &lt;</span><span style="color: #a31515">runtarget</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">@{target}</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">      &lt;/</span><span style="color: #a31515">then</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;/</span><span style="color: #a31515">if</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">sequential</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">macrodef</span><span style="color: blue">&gt;</span></p>
</div>
<p>This macrodef depends on a property being set after the successful execution of every target.  To accomplish this I created a simple logger to set a property for each target called; source is at the end of the post.  I also made sure that the logger was loaded with the script task at the beginning of the Ant project file.</p>
<div style="font-family: courier new; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml</span><span style="color: blue"> </span><span style="color: red">version</span><span style="color: blue">=</span>&#8220;<span style="color: blue">1.0</span>&#8220;<span style="color: blue"> </span><span style="color: red">encoding</span><span style="color: blue">=</span>&#8220;<span style="color: blue">UTF-8</span>&#8220;<span style="color: blue">?&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">project</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">scratch</span>&#8220;<span style="color: blue"> </span><span style="color: red">default</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue"> </span><span style="color: red">basedir</span><span style="color: blue">=</span>&#8220;<span style="color: blue">.</span>&#8220;<span style="color: blue"> &gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">taskdef</span><span style="color: blue"> </span><span style="color: red">resource</span><span style="color: blue">=</span>&#8220;<span style="color: blue">net/sf/antcontrib/antcontrib.properties</span>&#8220;<span style="color: blue"> /&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">typedef</span><span style="color: blue"> </span><span style="color: red">resource</span><span style="color: blue">=</span>&#8220;<span style="color: blue">AgilexAnt.properties</span>&#8220;<span style="color: blue"> /&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">script</span><span style="color: blue"> </span><span style="color: red">language</span><span style="color: blue">=</span>&#8220;<span style="color: blue">javascript</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;![CDATA[</span></p>
<p style="margin: 0px"><span style="color: gray">      importClass(Packages.com.agilex.ant.TargetListener);</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: gray">      var targetListener = new TargetListener();</span></p>
<p style="margin: 0px"><span style="color: gray">      project.setProjectReference(targetListener);</span></p>
<p style="margin: 0px"><span style="color: gray">      project.addBuildListener(targetListener);</span></p>
<p style="margin: 0px"><span style="color: gray">    </span><span style="color: blue">]]&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">script</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">package</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>deploy the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  …</span></p>
</div>
<p>Once you have this functionality you can begin to orchestrate in more robust ways.  With depends you can only string targets together, one after the other with no customization between the execution of each target.  Now you have the opportunity to wrap each and every target call with any customization you can write.  You can reuse in any way you want.  For this example we only want to compile and package on a developers machine (e.g. env.dev==true).</p>
<div style="font-family: courier new; background: none repeat scroll 0% 0% white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">property</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">env.dev</span>&#8220;<span style="color: blue"> </span><span style="color: red">value</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">target</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&#8220;<span style="color: blue">deploy</span>&#8220;<span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">recompile</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue"> </span><span style="color: red">if</span><span style="color: blue">=</span>&#8220;<span style="color: blue">${env.dev}</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">call</span><span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&#8220;<span style="color: blue">package</span>&#8220;<span style="color: blue"> </span><span style="color: red">once</span><span style="color: blue">=</span>&#8220;<span style="color: blue">true</span>&#8220;<span style="color: blue"> </span><span style="color: red">if</span><span style="color: blue">=</span>&#8220;<span style="color: blue">${env.dev}</span>&#8220;<span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">  &lt;</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span>deploy the missile<span style="color: blue">&lt;/</span><span style="color: #a31515">echo</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">target</span><span style="color: blue">&gt;</span></p>
</div>
<blockquote><p><font face="Consolas" color="#004080">c:\&gt;ant -f scratch.build.xml -Denv.dev=false<br />
Buildfile: scratch.build.xml </font></p>
<p><font face="Consolas" color="#004080">deploy:<br />
[echo] deploy the missile </font></p>
<p><font face="Consolas" color="#004080">BUILD SUCCESSFUL<br />
Total time: 0 seconds</font></p></blockquote>
<p>package com.agilex.ant;</p>
<p>import java.lang.reflect.Field;<br />
import java.util.Enumeration;<br />
import java.util.Hashtable;<br />
import java.util.Vector;</p>
<p>import org.apache.tools.ant.BuildEvent;<br />
import org.apache.tools.ant.BuildListener;<br />
import org.apache.tools.ant.Project;<br />
import org.apache.tools.ant.ProjectHelper;<br />
import org.apache.tools.ant.Target;</p>
<p>public class TargetListener implements BuildListener {</p>
<p>@Override<br />
public void buildFinished(BuildEvent arg0) {<br />
// TODO Auto-generated method stub<br />
}</p>
<p>@Override<br />
public void buildStarted(BuildEvent arg0) {<br />
// TODO Auto-generated method stub<br />
}</p>
<p>@Override<br />
public void messageLogged(BuildEvent arg0) {<br />
// TODO Auto-generated method stub<br />
}</p>
<p>@Override<br />
public void targetFinished(BuildEvent event) {<br />
Target target = event.getTarget();<br />
if (event.getException() != null)<br />
this.forceProperty(event.getProject(), event.getProject().getName() + &#8220;.Target.&#8221; + target.getName() + &#8220;.State&#8221;, &#8220;Failed&#8221;);<br />
else<br />
this.forceProperty(event.getProject(), event.getProject().getName() + &#8220;.Target.&#8221; + target.getName() + &#8220;.State&#8221;, &#8220;Success&#8221;);<br />
this.forceProperty(event.getProject(), event.getProject().getName() + &#8220;.Target.&#8221; + target.getName() + &#8220;.Executed&#8221;, Boolean.toString(true));<br />
}</p>
<p>@Override<br />
public void targetStarted(BuildEvent event) {<br />
Target target = event.getTarget();<br />
this.forceProperty(event.getProject(), &#8220;Target.&#8221; + target.getName() + &#8220;.State&#8221;, &#8220;Running&#8221;);<br />
}</p>
<p>@Override<br />
public void taskFinished(BuildEvent arg0) {<br />
// TODO Auto-generated method stub<br />
}</p>
<p>@Override<br />
public void taskStarted(BuildEvent arg0) {<br />
// TODO Auto-generated method stub<br />
}<br />
private Object getValue( Object instance, String fieldName ) throws IllegalAccessException, NoSuchFieldException {<br />
Field field = getField( instance.getClass(), fieldName );<br />
field.setAccessible( true );<br />
return field.get( instance );<br />
}<br />
private Field getField( Class thisClass, String fieldName ) throws NoSuchFieldException {<br />
if ( thisClass == null ) {<br />
throw new NoSuchFieldException( &#8220;Invalid field : &#8221; + fieldName );<br />
}<br />
try {<br />
return thisClass.getDeclaredField( fieldName );<br />
}<br />
catch ( NoSuchFieldException e ) {<br />
return getField( thisClass.getSuperclass(), fieldName );<br />
}<br />
}</p>
<p>private void forceProperty(Project project, String name, String value) {<br />
try {<br />
Hashtable properties = (Hashtable) getValue(project, &#8220;properties&#8221;);<br />
if ( properties == null ) {<br />
project.setUserProperty(name, this.parseProperty(project, value));<br />
}<br />
else {<br />
project.setProperty(name, this.parseProperty(project, value));<br />
}<br />
}<br />
catch ( Exception e ) {<br />
project.setUserProperty(name, this.parseProperty(project, value));<br />
}<br />
}</p>
<p>@SuppressWarnings(&#8220;deprecation&#8221;)<br />
private String parseProperty(Project project, String value){<br />
Vector fragments = new Vector();<br />
Vector propertyRefs = new Vector();<br />
ProjectHelper.parsePropertyString(value, fragments, propertyRefs);</p>
<p>if (propertyRefs.size() != 0) {<br />
StringBuffer sb = new StringBuffer();<br />
Enumeration i = fragments.elements();<br />
Enumeration j = propertyRefs.elements();<br />
while (i.hasMoreElements()) {<br />
String fragment = (String)i.nextElement();<br />
if (fragment == null) {<br />
String propertyName = (String)j.nextElement();<br />
fragment = project.getProperty(propertyName);<br />
}<br />
sb.append( fragment );<br />
}<br />
return sb.toString();<br />
}<br />
return value;<br />
}<br />
}</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.jayflowers.com/WordPress/?feed=rss2&#038;p=214</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
