<?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>//dennisbloete &#187; Rails</title>
	<atom:link href="http://dennisbloete.de/tags/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://dennisbloete.de</link>
	<description>Arbeit und Alltag eines Software-Entwicklers aus Bremen</description>
	<lastBuildDate>Sat, 04 Sep 2010 20:25:25 +0000</lastBuildDate>
	<language>de-de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rails deployment with Vlad, Git and Passenger</title>
		<link>http://dennisbloete.de/blog/rails-deployment-with-vlad-git-and-passenger/</link>
		<comments>http://dennisbloete.de/blog/rails-deployment-with-vlad-git-and-passenger/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 15:47:52 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Vlad]]></category>

		<guid isPermaLink="false">http://dennisbloete.de/?p=477</guid>
		<description><![CDATA[Now that Capistrano is discontinued, Vlad (at GitHub) seems to be the new cool deployment tool on the block. It works nicely with other usual suspects like Git and Passenger and uses Rake instead of reinventing the wheel &#8211; so let&#8217;s have a closer look. Getting started First of you need to install the Vlad [...]]]></description>
			<content:encoded><![CDATA[<p>Now that <a href="http://weblog.jamisbuck.org/2009/2/25/net-ssh-capistrano-and-saying-goodbye">Capistrano is discontinued</a>, <a href="http://rubyhitsquad.com/Vlad_the_Deployer.html">Vlad</a> (at <a href="http://github.com/seattlerb/vlad/tree/master">GitHub</a>) seems to be the new cool deployment tool on the block. It works nicely with other usual suspects like Git and Passenger and uses Rake instead of reinventing the wheel &#8211; so let&#8217;s have a closer look.</p>
<h3>Getting started</h3>
<p>First of you need to install the Vlad gem: <code>$ sudo gem install vlad</code></p>
<p>In its current version (1.3.2) Vlads default options are deploying from a SVN repository to a cluster of mongrels, which is not exactly what we are after. We need to configure it to use Git and Passenger, so switch to your Rails project and add the following lines to the end of the <em>Rakefile</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">begin</span>
  <span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'vlad'</span>
  Vlad.<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#ff3333; font-weight:bold;">:app</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:passenger</span>, <span style="color:#ff3333; font-weight:bold;">:scm</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:git</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">LoadError</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">'Could not load Vlad'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Run <code>$ rake -T vlad</code> to verify that Rake and Vlad know each other.</p>
<p>Now it&#8217;s time to <a href="http://hitsquad.rubyforge.org/vlad/doco/getting_started_txt.html">set up</a> your deployment configuration. Configuring Vlad is very similar to Capistrano, most of the <a href="http://hitsquad.rubyforge.org/vlad/doco/variables_txt.html">variables</a> are the same, so that you can easily <a href="http://hitsquad.rubyforge.org/vlad/doco/migration_txt.html">migrate</a> if you where using Capistrano before. Here is a simple configuration file including a deployment recipe which I&#8217;m currently using:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;myuser&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:domain</span>, <span style="color:#996600;">&quot;my.domain.com&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;myapp&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/var/www/#{application}&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>, <span style="color:#996600;">&quot;git@github.com:#{user}/#{application}.git&quot;</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:vlad</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">&quot;Symlinks the configuration files&quot;</span>
  remote_task <span style="color:#ff3333; font-weight:bold;">:symlink_config</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:web</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>application.<span style="color:#9900CC;">yml</span> database.<span style="color:#9900CC;">yml</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      run <span style="color:#996600;">&quot;ln -s #{shared_path}/config/#{file} #{current_path}/config/#{file}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">&quot;Full deployment cycle: Update, migrate, restart, cleanup&quot;</span>
  remote_task <span style="color:#ff3333; font-weight:bold;">:deploy</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:app</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#6666ff; font-weight:bold;">Rake::Task</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'vlad:update'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">invoke</span>
    <span style="color:#6666ff; font-weight:bold;">Rake::Task</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'vlad:symlink_config'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">invoke</span>
    <span style="color:#6666ff; font-weight:bold;">Rake::Task</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'vlad:migrate'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">invoke</span>
    <span style="color:#6666ff; font-weight:bold;">Rake::Task</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'vlad:start_app'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">invoke</span>
    <span style="color:#6666ff; font-weight:bold;">Rake::Task</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'vlad:cleanup'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">invoke</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h3>Gotchas</h3>
<p>It took me a while to get everything up and running because I encountered permission problems while trying to access the application repository from my deployment server. If you are running <code>$ rake vlad:update</code> and experience Git errors like <code>fetch-pack from '...' failed</code>, turn to <a href="http://jordanelver.co.uk/articles/2008/07/10/rails-deployment-with-git-vlad-and-ssh-agent-forwarding/">Jordan Elvers blog post about it</a> &#8211; he explains how you can solve this by setting up SSH agent forwarding.</p>
<h3>Advancing</h3>
<p>Need to go further and setup a multistage deployment environment? Check out <a href="http://blog.engineyard.com/2008/10/20/multi-environment-merb-dm-deployment-with-vlad-git">this post</a> on the Engine Yard blog, they solved this problem already.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennisbloete.de/blog/rails-deployment-with-vlad-git-and-passenger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t try this at home</title>
		<link>http://dennisbloete.de/blog/dont-try-this-at-home/</link>
		<comments>http://dennisbloete.de/blog/dont-try-this-at-home/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 00:05:51 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[EDD]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.dopefreshtight.de/artikel/dont-try-this-at-home/</guid>
		<description><![CDATA[Test-first ist für Feiglinge und sooo 2000 &#8211; wer was auf sich hält switcht spätestens nach diesem Artikel und springt auf den EDD-Bandwagon. EDD &#8211; alles klar? Exception Driven Development No code is faster than no code &#8211; was für die Applikation gilt, lässt sich auch 1A auf Tests und Spezifikationen anwenden, daher hier Credo [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Testgetriebene_Entwicklung">Test-first</a> ist für Feiglinge und sooo 2000 &#8211; wer was auf sich hält switcht spätestens nach diesem Artikel und springt auf den EDD-Bandwagon. EDD &#8211; alles klar?</p>
<h3>Exception Driven Development</h3>
<p>No code is faster than no code &#8211; was für die Applikation gilt, lässt sich auch 1A auf Tests und Spezifikationen anwenden, daher hier Credo Nr. 1:</p>
<blockquote><p>No test is faster than no test.</p></blockquote>
<p>Damit erübrigen sich auch die ganzen Diskussionen um langsame Tests durch zu viele Fixtures oder das ganze Mock/Stub-Geraffel. Test less!</p>
<p>Wer von sich überzeugt ist, deployed ohne Testsuite &#8211; no coverage is the new black. Ich weiss, das klingt fremd und sehr wagemutig &#8211; aber kein Ding, denn du musst diesen Weg nicht alleine gehen. Es gibt Hilfe, denn selbst die Besten machen Fehler &#8211; <a href="http://agilewebdevelopment.com/plugins/exception_notifier">Exception Notifier</a> to the rescue.</p>
<p>Spätestens wenn eine Anwendung in Produktion läuft, zahlen sich die Vorteile von EDD dank des Plugins voll aus: Du musst nicht mehr nach den Fehlern suchen, sie kommen zu dir &#8211; per E-Mail! Jede geworfene Exception erreicht dich per E-Mail und liefert dir detaillierte Informationen über den Fehler, so dass du ganz bequem das Error-Backlog aus deinem Postfach heraus abarbeiten kannst.</p>
<p>Klingt heftig und dabei ist hier noch nicht einmal Schluß &#8211; treiben wir es auf die Spitze&#8230;</p>
<h3>Soon to be released: Mister EDD</h3>
<p>Um euch allen den Einstieg in EDD zu erleichtern, schnüre ich aktuell ein feines Rails-Plugin zusammen, dass euch am Anfang etwas unter die Arme greift und Rails-like sehr opinionated zur Sache geht: Bei der Installation wird zunächst als Dependency das Exception Notifier Plugin installiert (sofern du es nach dem letzten Abschnitt nicht schon selbst eingebunden hast).</p>
<p>Next Step: Test- und Spec-Verzeichnisse werden gelöscht, wenn schon, denn schon&#8230; you cant be any geek off the street, gotta be handy with the steel if you know what I mean, earn your keep!</p>
<p>Zu guter letzt werden noch die Rails- und RSpec-Generatoren überschrieben, so dass in Zukunft keine störenden Tests mehr generiert werdenÂ  (danke für den Hinweis, <a href="http://localhost3000.de/">Jan</a>).</p>
<p>Denkt mal drüber nach <img src='http://dennisbloete.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://dennisbloete.de/blog/dont-try-this-at-home/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
