<?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>Multunus &#187; Leena</title>
	<atom:link href="http://www.multunus.com/author/leena/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.multunus.com</link>
	<description>Multunus Blog</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:02:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Continuous Delivery: Building Android Library project</title>
		<link>http://www.multunus.com/2011/11/continuous-delivery-building-android-library-project/</link>
		<comments>http://www.multunus.com/2011/11/continuous-delivery-building-android-library-project/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 09:25:20 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Continuous Delivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1960</guid>
		<description><![CDATA[This post talks about how to build an Android Project using ant which depends on an Android Library project.

Add default.properties in the library project and add android.library=true in the same
Run the command in the main Android Project android update project &#8211;path . &#8211;library ../path-to-the-library/Note: This always has to be relative path.
Now running ant release should build the [...]]]></description>
			<content:encoded><![CDATA[<p>This post talks about how to build an Android Project using ant which depends on an Android Library project.</p>
<ul>
<li>Add default.properties in the library project and add <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">android.library=true </span>in the same</li>
<li>Run the command in the main Android Project <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">android update project &#8211;path . &#8211;library ../path-to-the-library/</span><strong>Note: This always has to be relative path.</strong></li>
<li>Now running <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">ant release</span> should build the library project too.</li>
</ul>
<p><strong>Note:</strong> The android command mentioned in the second step adds an entry in the <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">default.properties</span> file. If you need to override that in different environments, override that in the <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">local.properties</span>. Even there, it has to be relative path, the absolute path will not work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/11/continuous-delivery-building-android-library-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery for Android Apps – Part 2</title>
		<link>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/</link>
		<comments>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 06:51:57 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1742</guid>
		<description><![CDATA[This post talks about how to run tests for the build setup as mentioned in Part 1.
Generate the build script for test
The suggested practice is to have 2 separate projects for android, one the source and the other for the tests. The following command will generate a build.xml for the test project. Replace the  with [...]]]></description>
			<content:encoded><![CDATA[<p>This post talks about how to run tests for the build setup as mentioned in <a href="/continuous-delivery-for-android-apps-part-1/">Part 1</a>.</p>
<h3><span style="text-decoration: underline;">Generate the build script for test</span></h3>
<p>The suggested practice is to have 2 separate projects for android, one the source and the other for the tests. The following command will generate a build.xml for the test project. Replace the  with the path of the source path.</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">android update test-project -m ../&lt;project-path&gt; -p . </span></p>
<p>One problem I&#8217;ve seen is that, it does not break the build even if there are failures in the test. Issue is reported here:</p>
<p><a href="http://code.google.com/p/android/issues/detail?id=14241">http://code.google.com/p/android/issues/detail?id=14241</a></p>
<p>I had to override the run-tests target as mentioned below to fix this issue:</p>
<pre>&lt;target name="run-tests" depends="-install-tested-project, install"
description="Runs tests from the package defined in test.package property"&gt;
    &lt;echo&gt;Running tests ...&lt;/echo&gt;
    &lt;exec executable="${adb}" failonerror="true" outputproperty="tests.output"&gt;
        &lt;arg value="shell" /&gt;
        &lt;arg value="am" /&gt;
        &lt;arg value="instrument" /&gt;
        &lt;arg value="-w" /&gt;
        &lt;arg value="-e" /&gt;
        &lt;arg value="coverage" /&gt;
        &lt;arg value="@{emma.enabled}" /&gt;
        &lt;arg value="${manifest.package}/${test.runner}" /&gt;
    &lt;/exec&gt;
    &lt;echo message="${tests.output}"/&gt;
    &lt;fail message="Tests failed!!!"&gt;
        &lt;condition&gt;
            &lt;or&gt;
            &lt;contains string="${tests.output}" substring="Error" /&gt;
            &lt;contains string="${tests.output}" substring="Fail" /&gt;
            &lt;/or&gt;
        &lt;/condition&gt;
     &lt;/fail&gt;
&lt;/target&gt;</pre>
<p>You can change the ant commands to <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">clean run-tests release </span>in Jenkins to run the tests as part of packaging.</p>
<p>Next I will be writing about how to start emulator from Jenkins while running the tests.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=96462303-c79f-4147-ace0-66d89521eb71" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery for Android Apps &#8211; Part 1</title>
		<link>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/</link>
		<comments>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 11:15:50 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[continuousdelivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1705</guid>
		<description><![CDATA[
We&#8217;ve set up our CI server for building android apps. We use Jenkins as our CI server, but the same steps can be applied to any CI server.
Setup Android Environment on CI server
You need to first install the android SDK and platform tools on the CI server. The steps are well defined here. You can run [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>We&#8217;ve set up our CI server for building android apps. We use Jenkins as our CI server, but the same steps can be applied to any CI server.</p>
<h3><span style="text-decoration: underline">Setup Android Environment on CI server</span></h3>
<p>You need to first install the android SDK and platform tools on the CI server. The steps are well defined <a href="http://developer.android.com/sdk/installing.html">here</a>. You can run the command <code>android update sdk --no-ui</code> if the CI server is in an headless environment.</p>
<h3><span style="text-decoration: underline">Generate Build script</span></h3>
<p>Using android SDK tool , you can generate build script for the android project which contains the standard steps for building the app such as clean, compile, release, install etc. The following command will generate the build script, replace &lt;appname&gt;, &lt;target&gt; and &lt;project path&gt; accordingly.</p>
<pre>android update project -n &lt;appname&gt; -t &lt;target&gt; -p &lt;project directory&gt;</pre>
<p>This will create build.xml file under the project directory. You need to create build.properties file with the following contents:</p>
<pre>key.store=path-to-keystore
key.alias=[alias]
key.store.password=[pw]
key.alias.password=[pw2]</pre>
<p>You can generate the key file using keytoool or you can generate the key file from eclipse. Run the command  <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px">ant clean release<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 19px">, which will compile the files, and generate the apk files (it generates signed, unsigned and unaligned files). The signed version can be used for uploading to Android Market or for installing directly on any device. Couple of stuff to be noted here are:</span></span></p>
<ul>
<li>Ant version has to be 1.8.0 or higher.</li>
<li>Put the external libraries in the <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px">libs</span> directory. Build script automatically picks up the libraries put under libs directory, otherwise the script need to be changed to look at a different classpath.</li>
</ul>
<p>Checkin the build.xml, build.properties and the key file into the repository.</p>
<h3><span style="text-decoration: underline">Setup the CI server</span></h3>
<p>The CI server has to run the ant script for building the app. One more setting what we&#8217;ve done in our Jenkins server was to archive the apks as artifacts (available in the post build action). In upcoming posts, I will cover how to do the following:</p>
<ol>
<li>Running android tests</li>
<li>Running code/test coverage tools</li>
<li>Actual deployment</li>
</ol>
<p>References: <a href="http://skaug.no/ingvald/2011/09/android-app-with-jenkins/" target="_blank">http://skaug.no/ingvald/2011/09/android-app-with-jenkins/</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuilding in Jenkins</title>
		<link>http://www.multunus.com/2011/09/rebuilding-in-jenkins/</link>
		<comments>http://www.multunus.com/2011/09/rebuilding-in-jenkins/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 14:32:49 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[Continuous Delivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1719</guid>
		<description><![CDATA[
One option that might be required after setting up a build pipeline is the provision to redeploy an earlier version by click of a button. This can become handy when we find a bug in the production and want to see when the bug got introduced. For that we will have to redeploy the earlier version [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>One option that might be required after setting up a <a href="http://continuousdelivery.in/2011/08/continuous-delivery-setup-jenkins-build-pipeline-setup/">build pipeline</a> is the provision to redeploy an earlier version by click of a button. This can become handy when we find a bug in the production and want to see when the bug got introduced. For that we will have to redeploy the earlier version to the staging/UAT environment and test the same.</p>
<p>Jenkins by default does not allow to rerun any of the earlier jobs. But you can achieve this by the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin">Rebuild</a> plugin. It allows you to rebuild any job provided its parameterized build. It also allows you override the parameters. It will show the &#8220;Rebuild&#8221; button at the left side as shown below when you go to a specific build page:</p>
<p><a rel="attachment wp-att-1814" href="http://www.multunus.com/?attachment_id=1814"><img src="http://continuousdelivery.in/wp-blog/wp-content/uploads/2011/09/rebuild.png" alt="" width="156" height="247" /></a></p>
<p>This is not a replacement for revert build, because it does not take care of reverting DB. But this can be extended to do the same.</p>
<p>Note: It will show the Rebuild button only for those builds which occurred after installing the plugin. I took some time to realize this and it is not very clear in the documentation.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/09/rebuilding-in-jenkins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 4: Rolling back database migrations with Capistrano rollback</title>
		<link>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/</link>
		<comments>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 08:22:40 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1527</guid>
		<description><![CDATA[According to the book Continuous Delivery, the database also should be under version control, and Rails allows us to achieve this with ActiveRecord Migrations. Even though Capistrano can run the migrations automatically with its deploy command, its deploy:rollback task does not rollback the DB migrations automatically.  I&#8217;ve created a small capistrano recipe which can take care [...]]]></description>
			<content:encoded><![CDATA[<p>According to the book <a href="http://www.amazon.com/gp/product/0321601912?tag=contindelive-20">Continuous Delivery</a>, the database also should be under version control, and Rails allows us to achieve this with ActiveRecord Migrations. Even though <a class="zem_slink" title="Capistrano" rel="homepage" href="http://www.capify.org/">Capistrano</a> can run the migrations automatically with its <code>deploy</code> command, its <code>deploy:rollback</code> task does not rollback the DB migrations automatically.  I&#8217;ve created a small capistrano <a href="https://github.com/multunus/capistrano-db-rollback">recipe</a> which can take care of rolling back migrations.  The assumptions made are:</p>
<ul>
<li>All the migrations have the <code>down</code> method defined properly. You can check for this by running <code>rake db:migrate:redo</code></li>
<li>The schema.rb exists in the repository. This is one of the <a href="http://guides.rubyonrails.org/migrations.html#schema-dumps-and-source-control">suggested practices</a> for Rails.</li>
</ul>
<p>The script is very simple, it extracts the version from the <code>schema.rb</code> and runs the <code>rake db:migrate</code> with the same version. The task gets run automatically along with <code>deploy:rollback</code>. This approach should work for most small and medium complexity Rails apps.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=37c95294-b89a-4f0c-91c2-51a1717f4ba4" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 3: Running custom rake tasks during deployment</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-contd/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-contd/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:50:54 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[continuousdelivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1482</guid>
		<description><![CDATA[One problem we faced with the pipeline setup what I had mentioned in my first post was that &#8211; it was not handling how to run the extra tasks that we need to do in some of the deployments. Some examples are:

Reindex the solr/lucene indexes if any new field has been added to the index
Some [...]]]></description>
			<content:encoded><![CDATA[<p>One problem we faced with the pipeline setup what I had mentioned in my <a href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">first post</a> was that &#8211; it was not handling how to run the extra tasks that we need to do in some of the deployments. Some examples are:</p>
<ul>
<li>Reindex the solr/lucene indexes if any new field has been added to the index</li>
<li>Some custom rake tasks , say for eg: task to update values in the DB, which you don&#8217;t want to add to migrations</li>
</ul>
<p>We do have Cap tasks for running the required rake tasks, but again it was done manually. So we&#8217;ve to remember to run them after deploying to production.  And also there is no way to track what steps were followed for a certain deployment.</p>
<p>I used the build parameter again for fixing the above issue i.e. after accepting the extra tasks as parameter for the build for the first job, they will be passed on to the downstream jobs. In this way the same deployment steps will be automatically followed for rest of the jobs in the pipeline.</p>
<p>The only difference in this case is that &#8211; sometimes the parameter can be empty. This check has to be done in the scripts i.e. if the value exists for the parameter, execute the extra tasks along with the normal deployment else just do a normal deployment.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0a6adeff-692b-401b-9726-093189c9c0b1" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-contd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 2: Code metrics with metrical</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:44:40 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1500</guid>
		<description><![CDATA[Metrical is for easier metric_fu setup. You can see the details on why and how here. Its an awesome tool which allows us to easily use metric_fu without adding any dependency to the project code.
The steps I followed for setting it up in our Jenkins server are:

 Install the gem. I installed it under our [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://iain.nl/easier-metricfu-with-metrical">Metrical</a> is for easier <a href="http://metric-fu.rubyforge.org/">metric_fu</a> setup. You can see the details on why and how <a href="http://iain.nl/easier-metricfu-with-metrical">here</a>. Its an awesome tool which allows us to easily use metric_fu without adding any dependency to the project code.</p>
<p>The steps I followed for setting it up in our Jenkins server are:</p>
<ul>
<li> Install the gem. I installed it under our ruby 1.9.2 in RVM.</li>
<li> Create a .metrics file under your projects directory with the settings. This is not mandatory, but I had to use this because some configurations do not seem to be working with ruby 1.9.2. I&#8217;ve mentioned those below along with the contents of the .metrics file</li>
<li> Create a job in Jenkins server, mention the repository details and for build step give the shell command as <em>rvm 1.9.2 -S metrical</em></li>
<li> Configure the <a href="https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin">HTML Publisher plugin</a> for showing the nice Graphs generated by metric_fu as part of the build report. The default report location is tmp/metric_fu/output under the project directory. You can change the same in .metrics file.</li>
</ul>
<p>As I mentioned above, tools such as flay and flog, which comes as part of metric_fu, have <a href="https://github.com/iain/metrical/issues/4">issues</a> working with ruby 1.9.2. And the same case with stats graph and syntax highlighting. The same case with <a href="https://github.com/relevance/rcov/issues/8">rcov</a> also. So I had to create a <em><strong>.metrics</strong></em> file with the following contents and put in the project dir:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;"> </span></p>
<pre class="brush: ruby;">
MetricFu::Configuration.run do |config|
        config.code_dirs = ['app', 'lib']
        config.syntax_highlighting = false
        config.metrics  = [:churn,:reek,:roodi,:hotspots,:rails_best_practices]
        config.graphs   = [:reek, :roodi, :rails_best_practices]
        config.rcov[:test_files] = ['spec/**/*_spec.rb']
        config.rcov[:rcov_opts] &lt;&lt; &quot;-Ispec&quot; # Needed to find spec_helper
end
</pre>
<p>For test coverage I&#8217;ve used <a href="https://github.com/colszowka/simplecov">Simplecov</a> which is easy to setup. It will generate the coverage report whenever you run the tests. This also generated html report which can be integrated easily into Jenkins. As mentioned <a href="https://github.com/colszowka/simplecov/issues/42">here</a> in the issue list, it does not generate the report when you are running with <a href="https://github.com/timcharper/spork/wiki">spork</a>.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blueprint &#8211; reverse engineering your server configuration</title>
		<link>http://www.multunus.com/2011/07/blueprint-reverse-engineering-your-server-configuration/</link>
		<comments>http://www.multunus.com/2011/07/blueprint-reverse-engineering-your-server-configuration/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:35:16 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1489</guid>
		<description><![CDATA[There are many tools like Chef, Puppet etc. to manage the server configuration, but there are not many which do the reverse i.e. create a configuration from an existing server. Blueprint does exactly the latter.
Its a set of python scripts which reverse engineer your server configuration. It stores the configuration locally in its own repository, [...]]]></description>
			<content:encoded><![CDATA[<p>There are many tools like <a href="http://wiki.opscode.com/display/chef/Home">Chef</a>, <a href="http://projects.puppetlabs.com/projects/puppet">Puppet</a> etc. to manage the server configuration, but there are not many which do the reverse i.e. create a configuration from an existing server. <a href="https://github.com/devstructure/blueprint">Blueprint</a> does exactly the latter.</p>
<p>Its a set of python scripts which reverse engineer your server configuration. It stores the configuration locally in its own repository, but you can also:</p>
<ul>
<li>Create Puppet/Chef scripts</li>
<li>Convert into a normal shell script</li>
<li>Using <a href="https://github.com/devstructure/blueprint-io">Blueprint I/O</a>, store the configuration in remote server and pull it when required</li>
</ul>
<p>It scans all the packages installed on the machine and adds those into the configuration. According to the <a href="https://devstructure.com/docs/tutorial.html">tutorial</a>, you can do this on a dedicated server or on virtual servers created using <a href="http://www.virtualbox.org/">VirtualBox</a> etc, or on cloud servers like <a href="http://aws.amazon.com/ec2">Amazon EC2</a>, <a href="http://www.rackspacecloud.com/cloud_hosting_products/servers">Rackspace</a> etc.</p>
<p>I&#8217;ve tried it on a dedicated server (i.e. our CI server) as well as on an EC2 server. I faced a couple of issues, but with their help (see issues <a href="https://github.com/devstructure/blueprint/issues/71">71</a> and <a href="https://github.com/devstructure/blueprint/issues/63">63</a>), got those fixed.</p>
<p>While bringing up the EC2 instance, you can give the shell script created by Blueprint as user data, provided the size of the script is below 16384 bytes.</p>
<p>Its really an awesome tool. I got the reference to it from <a href="http://ruby5.envylabs.com/episodes/189-episode-186-june-24-2011/stories/1668-blueprint">Ruby5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/blueprint-reverse-engineering-your-server-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Issue while installing Java in EC2 Micro instance</title>
		<link>http://www.multunus.com/2011/07/issue-while-installing-java-in-ec2-micro-instance/</link>
		<comments>http://www.multunus.com/2011/07/issue-while-installing-java-in-ec2-micro-instance/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 14:22:30 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1409</guid>
		<description><![CDATA[When I tried to install Java in our EC2 micro instance, it stopped responding. There was no luck even after restarting the instance. I thought it might be a specific issue with that particular instance, so tried it again by bringing up a new micro instance and every time it was the same behaviour. I [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried to install Java in our <a href="http://aws.amazon.com/ec2/instance-types/">EC2 micro instance</a>, it stopped responding. There was no luck even after restarting the instance. I thought it might be a specific issue with that particular instance, so tried it again by bringing up a new micro instance and every time it was the same behaviour. I then googled and discovered it as a known <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/634487">issue</a> reported back in September 2010. The suggested workaround is:</p>
<ul>
<li>Bring up a small instance</li>
<li>Install Java</li>
<li>Convert it into micro instance.</li>
</ul>
<p>Converting of the instance can be done using <a href="http://aws.amazon.com/developertools/351">API tools</a>, or from the <a href="http://www.kinlane.com/2011/03/easier-scalability-with-aws/">AWS Console</a>. But for me this option was never enabled from the console. I don&#8217;t know why. Of course, the API option would still work, I suppose.</p>
<p>But after looking at the bug in detail, I could see a solution which uses the linux <a href="http://linux.about.com/library/cmd/blcmdl1_nice.htm">nice</a> command, and that did the trick for me. You can see the script as the last comment. The script is as follows:</p>
<pre class="Bash/shell">
#!/bin/bash
sudo add-apt-repository "deb <a rel="nofollow" href="http://archive.canonical.com/">http://archive.canonical.com/</a> natty partner"
sudo apt-get update
#Accept the Java license.
for i in bin jdk jre; do
echo "sun-java6-$i shared/accepted-sun-dlj-v1-1 select true" | sudo debconf-set-selections
done
# convoluted way to install java. this seems to only work some times! Race condition?
# <a rel="nofollow" href="https://forums.aws.amazon.com/message.jspa?messageID=199841#199841">https://forums.aws.amazon.com/message.jspa?messageID=199841#199841</a>
sudo nice --adjustment=19 apt-get install -y sun-java6-jre
<span style="font-family: monospace;">
</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/issue-while-installing-java-in-ec2-micro-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 1: Our Jenkins Build Pipeline setup</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 14:28:55 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1417</guid>
		<description><![CDATA[As part of our journey towards implementing Continous Delivery, I&#8217;ve added the Build pipeline for our continous integration server Jenkins.  There are quite a few resources available on the net on how to add the plugin and configure it. This blog is not about how to configure the plugin, but more on how I&#8217;ve configured [...]]]></description>
			<content:encoded><![CDATA[<p>As part of our journey towards implementing <a href="http://continuousdelivery.com/">Continous Delivery</a>, I&#8217;ve added the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin">Build pipeline</a> for our continous integration server <a href="http://jenkins-ci.org/">Jenkins</a>.  There are quite a few resources available on the net on how to add the plugin and configure it. This blog is not about how to configure the plugin, but more on how I&#8217;ve configured it for one of our projects and issues I faced while doing the same.</p>
<p>The pipeline we have now is very simple. They are:</p>
<ul>
<li>Run all the RSpec tests</li>
<li>Run the Javascript Unit tests</li>
<li>Deploy to staging</li>
<li>Deploy to production</li>
</ul>
<p><strong>The problems we had with our earlier approach, and how the current approach solved those problems:</strong></p>
<p>What we had in the past was, simple scripts with the above items. We had a job for running the tests. If the build was successful, we would run <a href="https://github.com/capistrano/capistrano">capistrano</a> scripts to deploy to staging and once the customer gave the thumbs up, we&#8217;d push it to production.  There are a series of steps that we had to do for each deployment. For eg:  for staging deployment:</p>
<ul>
<li>Merge the &#8220;staging&#8221; branch with master</li>
<li>Run the cap script</li>
<li>Tag the build</li>
</ul>
<p>And almost similar steps needed to be followed for production deployment also. The usual problems that we used to face are:</p>
<ul>
<li>There is no way we knew what deployment was done on a certain day for what</li>
<li>All staging updates would not get pushed to production, so it was a tough task to identify which tag to merge when we were finally ready for a production update</li>
</ul>
<p>With the current approach, the advantages are:</p>
<ul>
<li>Its a one click deployment, so rare chance of making any kind of mistake</li>
<li>We can clearly see when a feature has been moved to staging, and whether it has been pushed to production or not</li>
<li>Anyone can do deployment as it is just a click of a button. We may even be able to teach the client how to do this.</li>
</ul>
<p>One of the major problems I had faced in the earlier &#8220;manual&#8221; system &#8211; was the inability to pass parameters between builds. For example, once the app would be moved to staging, a tag is created and when its ready to be pushed to production, we&#8217;d have to merge that particular tag to production and then push it.</p>
<p>To achieve the above I used the &#8220;parameterized build&#8221; option. In Jenkins, the parameters get converted to Environment Variables and got passed to the downstream job. This is how you can set the parameterized build:</p>
<p style="text-align: left;">
<a href="http://www.multunus.com/wp-blog/wp-content/gallery/images/parameterized_build_new.png" target="_new" title=""  >
	<img class="ngg-singlepic ngg-center" src="http://www.multunus.com/wp-blog/wp-content/gallery/cache/184__620x300_parameterized_build_new.png" alt="Parameterized Build" title="Parameterized Build" />
</a>
</p>
<p>When you fire the build, it prompts for the value of the TAG parameter. Once entered this would be available as an Environment variable for this job and all its downstream jobs.</p>
<p>For eg: in the pipeline, the downstream project is &#8220;Stage deploy&#8221;, and it will know the value for TAG and uses that value to create a tag in Git after successful deployment.</p>
<p>When it is ready for production deployment it merges with the same tag and deploys to production. In the latest version of the plugin, moving to the next step is <strong>not</strong> triggered automatically and you can retry the failed ones. The following is a sample pipeline dashboard view:</p>

<a href="http://www.multunus.com/wp-blog/wp-content/gallery/images/pipeline-new.png" target="_new" title=""  >
	<img class="ngg-singlepic ngg-center" src="http://www.multunus.com/wp-blog/wp-content/gallery/cache/183__620x300_pipeline-new.png" alt="Build Pipeline" title="Build Pipeline" />
</a>

<p><strong>Note:</strong> Capturing the parameter will happen <strong>only</strong> for the first job. So, if the parameterized job is <em>not</em> the first one in the pipeline, the capture of the parameter will not happen.</p>
<p>So we&#8217;ve reached the &#8220;one click deployment stage&#8221; with this. But we&#8217;ve still got the following pending tasks &#8211; based on what&#8217;s mention in the book  <a href="http://www.informit.com/store/product.aspx?isbn=0321601912">Continuous Delivery</a>:</p>
<ul>
<li>Rolling back the bad builds</li>
<li>Add non-functional tests to the pipeline i.e. performance and security tests</li>
<li>Feature flags</li>
<li>Zero downtime deployment</li>
<li>Canary Releases (Something on the lines of A/B testing)</li>
</ul>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
<p>References:</p>
<ul>
<li><a href="http://weblogs.java.net/blog/johnsmart/archive/2011/03/10/build-pipelines-jenkinshudson">http://weblogs.java.net/blog/johnsmart/archive/2011/03/10/build-pipelines-jenkinshudson</a></li>
<li><a href="http://continuousdelivery.com/patterns">http://continuousdelivery.com/patterns</a></li>
<li><a href="http://www.quora.com/How-does-Etsy-manage-development-and-operations" target="_blank">http://www.quora.com/How-does-Etsy-manage-development-and-operations</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

