<?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>A Tempest of Thoughts &#187; Capistrano</title>
	<atom:link href="http://tempe.st/category/capistrano/feed/" rel="self" type="application/rss+xml" />
	<link>http://tempe.st</link>
	<description>aka blog.to_int(:inig)</description>
	<lastBuildDate>Thu, 07 Apr 2011 08:24:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Deploy Drupal with Capistrano, a year later</title>
		<link>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/</link>
		<comments>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 14:07:52 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=295</guid>
		<description><![CDATA[Here&#8217;s the slides for the presentation I gave at the latest Ruby Social Club in Milano. Deploy Drupal With Capistrano A Year LaterView more PDF documents from intinig.]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s the slides for the presentation I gave at the latest Ruby Social Club in Milano.</p>
<div style="width:425px;text-align:left" id="__ss_1603333"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/intinig/deploy-drupal-with-capistrano-a-year-later?type=presentation" title="Deploy Drupal With Capistrano A Year Later">Deploy Drupal With Capistrano A Year Later</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=deploydrupalwithcapistranoayearlater-090618090126-phpapp02&#38;rel=0&#38;stripped_title=deploy-drupal-with-capistrano-a-year-later" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=deploydrupalwithcapistranoayearlater-090618090126-phpapp02&#38;rel=0&#38;stripped_title=deploy-drupal-with-capistrano-a-year-later" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">PDF documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/intinig">intinig</a>.</div></div>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two improvements to your Capfiles</title>
		<link>http://tempe.st/2008/10/two-improvements-to-your-capfiles/</link>
		<comments>http://tempe.st/2008/10/two-improvements-to-your-capfiles/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 17:45:36 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[capfile]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[recipes]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=251</guid>
		<description><![CDATA[I have lately started using a pattern that has become quite common among capistrano users: setting the server names and locations in a task. Doing this allows you to have multiple deployment environments, like development, staging, production, and so on. desc &#34;deploy to development environment&#34; task :development do set :deploy_to, &#34;/var/apps/#{application}&#34; &#160; role :web, &#34;servername.mikamai.com&#34;, [...]]]></description>
			<content:encoded><![CDATA[	<p>I have lately started using a pattern that has become quite common among capistrano users: setting the server names and locations in a task. Doing this allows you to have multiple deployment environments, like <em>development</em>, <em>staging</em>, <em>production</em>, and so on.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">desc <span style="color:#996600;">&quot;deploy to development environment&quot;</span>
task <span style="color:#ff3333; font-weight:bold;">:development</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/var/apps/#{application}&quot;</span>
&nbsp;
  role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;servername.mikamai.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
  role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;servername.mikamai.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
  role <span style="color:#ff3333; font-weight:bold;">:db</span>, <span style="color:#996600;">&quot;servername.mikamai.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
  set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;username&quot;</span>
  set <span style="color:#ff3333; font-weight:bold;">:password</span>, <span style="color:#996600;">&quot;secr3t&quot;</span>
  set <span style="color:#ff3333; font-weight:bold;">:remote_mysqldump</span>, <span style="color:#996600;">&quot;/usr/bin/mysqldump&quot;</span>
&nbsp;
  set <span style="color:#ff3333; font-weight:bold;">:db_user</span>, <span style="color:#996600;">&quot;username&quot;</span>
  set <span style="color:#ff3333; font-weight:bold;">:db_password</span>, <span style="color:#996600;">&quot;secre7&quot;</span>
  set <span style="color:#ff3333; font-weight:bold;">:db_name</span>, <span style="color:#996600;">&quot;db_name&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

	<p>This technique has proven itself to be really useful, especially when clients start to ask for deployments on their test servers, and you still want to be able to deploy to your development servers.</p>
	<p>While refactoring my Capfiles I also took the time to rewrite the <strong>drupal:db</strong> namespace, adding the much needed tasks that allow you dump the remote databases and download them to your development box.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  namespace <span style="color:#ff3333; font-weight:bold;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>    
    namespace <span style="color:#ff3333; font-weight:bold;">:dump</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      desc <span style="color:#996600;">&quot;Deletes old database dumps, leaves only the latest on the server&quot;</span>
      task <span style="color:#ff3333; font-weight:bold;">:cleanup</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;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        dumps = capture<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ls -xt #{shared_path}/dumps&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#CC0066; font-weight:bold;">split</span>.<span style="color:#9900CC;">reverse</span>
        run <span style="color:#996600;">&quot;cd #{shared_path}/dumps; rm #{dumps[0..-2].join(&quot;</span> <span style="color:#996600;">&quot;)}&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      desc <span style="color:#996600;">&quot;Dumps the local database&quot;</span>
      task <span style="color:#ff3333; font-weight:bold;">:local</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;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">RuntimeError</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;failed dump&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;#{local_mysqldump} -u #{local_db_user} --password=#{local_db_password} #{local_db_name} &gt; dump.sql&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      namespace <span style="color:#ff3333; font-weight:bold;">:remote</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        desc <span style="color:#996600;">&quot;Dumps the remote database&quot;</span>
        task <span style="color:#ff3333; font-weight:bold;">:default</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;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
          filename = <span style="color:#996600;">&quot;#{Time.now.to_i.to_s}.dump.sql&quot;</span>
          run <span style="color:#996600;">&quot;cd #{shared_path}/dumps; #{remote_mysqldump} -u #{db_user} --password=#{db_password} #{db_name} &gt; #{filename}&quot;</span>
          run <span style="color:#996600;">&quot;cd #{shared_path}/dumps; bzip2 #{filename}&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>          
&nbsp;
        namespace <span style="color:#ff3333; font-weight:bold;">:download</span> <span style="color:#9966CC; font-weight:bold;">do</span>
          desc <span style="color:#996600;">&quot;Dumps and downloads the remote database&quot;</span>
          task <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#9966CC; font-weight:bold;">do</span>
            drupal::db::dump::remote::default
            latest
          <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
          desc <span style="color:#996600;">&quot;Downloads the latest database dump&quot;</span>
          task <span style="color:#ff3333; font-weight:bold;">:latest</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;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
            dumps = capture<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ls -xt #{shared_path}/dumps&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#CC0066; font-weight:bold;">split</span>.<span style="color:#9900CC;">reverse</span>
            get<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{shared_path}/dumps/#{dumps.last}&quot;</span>, <span style="color:#996600;">&quot;./#{dumps.last}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>



 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2008/10/two-improvements-to-your-capfiles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to ease Drupal development with Capistrano</title>
		<link>http://tempe.st/2008/07/how-to-ease-drupal-development-with-capistrano/</link>
		<comments>http://tempe.st/2008/07/how-to-ease-drupal-development-with-capistrano/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 07:12:58 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=240</guid>
		<description><![CDATA[Drupal is a great piece of software, unfortunately it stores so much stuff in the db that people struggle keeping in sync the development server/box and a staging server to show their customers how the work is proceeding. Today I will share the Capistrano tasks I use to sync my development box with the staging [...]]]></description>
			<content:encoded><![CDATA[	<p>Drupal is a great piece of software, unfortunately it stores so much stuff in the db that people struggle keeping in sync the development server/box and a staging server to show their customers how the work is proceeding.</p>
	<p>Today I will share the Capistrano tasks I use to sync my development box with the staging server. What I basically do is dumping the development db, sending it to the server via capistrano and then use the dump to replace the server&#8217;s database.</p>
	<p>The following tasks should be used together with the tasks in my <a href="http://tempe.st/2008/07/deploying-drupal-with-capistrano/">Deploying drupal with Capistrano</a> article. I took advantage of deploy:cold not being needed with Drupal, and added a callback to it, so if you want to do a deploy that also updated the database you should use deploy:cold.</p>
	<p>You should also have two settings files (usually stored in drupal_root/sites/default), one called settings.development.php, with your local database setup and one called settings.production.php with the remote database setup, the capistrano tasks will take care of choosing the correct one.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Callbacks</span>
before <span style="color:#996600;">'deploy:start'</span>, <span style="color:#996600;">'drupal:db:import:production'</span>
before <span style="color:#996600;">'deploy:restart'</span>, <span style="color:#996600;">'drupal:configure:production'</span>
before <span style="color:#996600;">'deploy:start'</span>, <span style="color:#996600;">'drupal:configure:production'</span>
before <span style="color:#996600;">'deploy:cold'</span>, <span style="color:#996600;">'drupal:db:dump:development'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># DB Stuff</span>
set <span style="color:#ff3333; font-weight:bold;">:mysqldump</span>, <span style="color:#996600;">&quot;/path/to/mysqldump&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:local_db_user</span>, <span style="color:#996600;">&quot;local_mysql_username&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:local_db_password</span>, <span style="color:#996600;">&quot;local_mysql_password&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:local_db_name</span>, <span style="color:#996600;">&quot;local_db_name&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:db_user</span>, <span style="color:#996600;">&quot;remote_mysql_username&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:db_password</span>, <span style="color:#996600;">&quot;remote_mysql_password&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:db_name</span>, <span style="color:#996600;">&quot;remote_db_name&quot;</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:drupal</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  namespace <span style="color:#ff3333; font-weight:bold;">:configure</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    task <span style="color:#ff3333; font-weight:bold;">:production</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      sudo <span style="color:#996600;">&quot;cp #{latest_release}/sites/default/settings.production.php #{latest_release}/sites/default/settings.php&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    task <span style="color:#ff3333; font-weight:bold;">:development</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      sudo <span style="color:#996600;">&quot;cp #{latest_release}/sites/default/settings.development.php #{latest_release}/sites/default/settings.php&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  namespace <span style="color:#ff3333; font-weight:bold;">:db</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    namespace <span style="color:#ff3333; font-weight:bold;">:dump</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      task <span style="color:#ff3333; font-weight:bold;">:development</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#CC00FF; font-weight:bold;">RuntimeError</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;failed dump&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;#{mysqldump} -u #{local_db_user} --password=#{local_db_password} #{local_db_name} &gt; dump.sql&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    namespace <span style="color:#ff3333; font-weight:bold;">:import</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      task <span style="color:#ff3333; font-weight:bold;">:production</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;FILES&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;dump.sql&quot;</span>
        deploy::upload
        run <span style="color:#996600;">&quot;mysql -u #{db_user} --password=#{db_password} #{db_name} &lt; #{latest_release}/dump.sql&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>



 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2008/07/how-to-ease-drupal-development-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying Drupal with Capistrano</title>
		<link>http://tempe.st/2008/07/deploying-drupal-with-capistrano/</link>
		<comments>http://tempe.st/2008/07/deploying-drupal-with-capistrano/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 21:02:48 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=230</guid>
		<description><![CDATA[Mikamai, the company I work for, has just released Montalbano.tv, the companion site to one of the most successful TV shows in Italy. I was the technical director of this Drupal based project, and while I was happy we chose Drupal, because it allowed us to deliver all the features they needed on time, I [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="http://mikamai.com">Mikamai</a>, the company I work for, has just released <a href="http://montalbano.tv">Montalbano.tv</a>, the companion site to one of the most successful TV shows in Italy.</p>
	<p>I was the technical director of this Drupal based project, and while I was happy we chose Drupal, because it allowed us to deliver all the features they needed on time, I almost panicked when they told us the production setup would have two servers, both with database and web serving duties.</p>
	<p>The database replication was standard MySql master-master setup, but I had to develop a strategy to keep the two code-bases on the two servers synchronized. </p>
	<p>Being a Ruby programmer at heart, I selected the only tool that never fails me in circumstances like the one we had: <a href="http://capify.org">Capistrano</a>.</p>
	<p>Unfortunately, while Capistrano is all easy to use with Rails, I had to write a custom Drupal-tailored Capfile.</p>
	<p>Here it is, in its entirety, in case you ever need to  deploy Drupal with cap (now I always deploy Drupal with cap, since I have the recipe ready <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'deploy'</span> <span style="color:#9966CC; font-weight:bold;">if</span> respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:namespace</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># cap2 differentiator</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Standard configuration</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;username&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:password</span>, <span style="color:#996600;">&quot;password&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;application.name&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># I like to deploy the code in /var/apps</span>
<span style="color:#008000; font-style:italic;"># and then link it to the webserver directory</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/var/apps/#{application}&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># SCM Stuff configure to taste, just remember the repository</span>
<span style="color:#008000; font-style:italic;"># here I used github as main repository</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>,  <span style="color:#996600;">&quot;git@github.com:username/project.git&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:scm</span>, <span style="color:#ff3333; font-weight:bold;">:git</span>
set <span style="color:#ff3333; font-weight:bold;">:branch</span>, <span style="color:#996600;">&quot;master&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:repository_cache</span>, <span style="color:#996600;">&quot;git_master&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_via</span>, <span style="color:#ff3333; font-weight:bold;">:remote_cache</span>
set <span style="color:#ff3333; font-weight:bold;">:scm_verbose</span>,  <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Two servers, double fun</span>
<span style="color:#008000; font-style:italic;"># You really don't need app, web and db here,</span>
<span style="color:#008000; font-style:italic;"># but I used all of them just to be sure.</span>
<span style="color:#008000; font-style:italic;"># Usually only web is ok.</span>
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;first.server.address.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;second.server.address.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;first.server.address.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;second.server.address.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>, <span style="color:#996600;">&quot;first.server.address.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>, <span style="color:#996600;">&quot;second.server.address.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
after <span style="color:#996600;">'deploy:setup'</span>, <span style="color:#996600;">'drupal:setup'</span> <span style="color:#008000; font-style:italic;"># Here we setup the shared files directory</span>
after <span style="color:#996600;">'deploy:symlink'</span>, <span style="color:#996600;">'drupal:symlink'</span> <span style="color:#008000; font-style:italic;"># After symlinking the code we symlink the shared dirs</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Before restarting the webserver we fix all the </span>
<span style="color:#008000; font-style:italic;"># permissions and then symlink it to production</span>
before <span style="color:#996600;">'deploy:restart'</span>, <span style="color:#996600;">'mikamai:permissions:fix'</span>, <span style="color:#996600;">'mikamai:symlink:application'</span>
&nbsp;
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:drupal</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#008000; font-style:italic;"># shared directories</span>
  task <span style="color:#ff3333; font-weight:bold;">:setup</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    sudo <span style="color:#996600;">&quot;mkdir -p #{shared_path}/files&quot;</span>
    sudo <span style="color:#996600;">&quot;chown -R #{user}:#{user} #{deploy_to}&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># symlink shared directories</span>
  task <span style="color:#ff3333; font-weight:bold;">:symlink</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    sudo <span style="color:#996600;">&quot;ln -s #{shared_path}/files #{latest_release}&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#008000; font-style:italic;"># adjusted finalize_update, removed non rails stuff</span>
  task <span style="color:#ff3333; font-weight:bold;">:finalize_update</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    sudo <span style="color:#996600;">&quot;chmod -R g+w #{latest_release}&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> fetch<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:group_writable</span>, <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  task <span style="color:#ff3333; font-weight:bold;">:restart</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># nothing to do here since we're on mod-php</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:mikamai</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#008000; font-style:italic;"># symlinking to production</span>
  namespace <span style="color:#ff3333; font-weight:bold;">:symlink</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    task <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      sudo <span style="color:#996600;">&quot;rm -rf /var/www/montalbano&quot;</span>
      sudo <span style="color:#996600;">&quot;ln -s #{latest_release} /var/www/montalbano&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># change ownership</span>
  namespace <span style="color:#ff3333; font-weight:bold;">:permissions</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    task <span style="color:#ff3333; font-weight:bold;">:fix</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      sudo <span style="color:#996600;">&quot;chown -R www-data:www-data #{latest_release}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>



 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2008/07/deploying-drupal-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>More Capistrano 2 goodies: A Radiant recipe library</title>
		<link>http://tempe.st/2007/10/more-capistrano-2-goodies-a-radiant-recipe-library/</link>
		<comments>http://tempe.st/2007/10/more-capistrano-2-goodies-a-radiant-recipe-library/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 13:32:18 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Nimboo]]></category>
		<category><![CDATA[Radiant]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/10/more-capistrano-2-goodies-a-radiant-recipe-library/</guid>
		<description><![CDATA[This is a followup to &#8220;A Couple of Capistrano 2 Recipes Libraries&#8221;:http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries It&#8217;s official: I am a Capistranoholist, and I can&#8217;t deploy any Rails application without using Capistrano anymore. A few days ago I had to setup a Radiant site for a client and I couldn&#8217;t resist writing a small capistrano recipe library (is there [...]]]></description>
			<content:encoded><![CDATA[	<p><em>This is a followup to &#8220;A Couple of Capistrano 2 Recipes Libraries&#8221;:http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries</em></p>
	<p>It&#8217;s official: I am a Capistranoholist, and I can&#8217;t deploy any Rails application without using Capistrano anymore. A few days ago I had to setup a Radiant site for a client and I couldn&#8217;t resist writing a small capistrano recipe library (is there an official name for this kind of collections?) with callbacks dedicated to radiant and tasks that help managing radiant installations.</p>
	<p>As usual you can get them from the <a href="http://github.com/intinig/radiant-recipes">recipes repository</a> .</p>
	<p>After you get the recipes load them from Capfile:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'deploy'</span> <span style="color:#9966CC; font-weight:bold;">if</span> respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:namespace</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># cap2 differentiator</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'config/deploy'</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'lib/recipes/medlar'</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'lib/recipes/radiant'</span></pre></div></div>

	<p>Now you will have one more callback and an overridden deploy:cold task:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  after <span style="color:#996600;">&quot;deploy:migrate&quot;</span>, <span style="color:#996600;">&quot;deploy:radiant:migrate:extensions&quot;</span>
&nbsp;
  desc <span style="color:#996600;">&quot;Overridden deploy:cold for Radiant.&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:cold</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    update
    <span style="color:#996600;">&quot;radiant:bootstrap&quot;</span>
    start
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

	<p>The overridden task bootstraps radiant during deploy:cold (but assumes you use it only the first time you deploy!), and the callback migrates radiant extensions whenever you migrate your db.</p>
	<p>If you don&#8217;t need the radiant recipes but you are using the medlar namespace I suggest you update from svn, there have been a lot of fixes to the recipes.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/10/more-capistrano-2-goodies-a-radiant-recipe-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A couple of capistrano 2 recipes libraries</title>
		<link>http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries/</link>
		<comments>http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 15:26:58 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Nimboo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries/</guid>
		<description><![CDATA[I kept playing with Capistrano 2 after my last article, and I&#8217;ve refactored quite a bit my recipes, finally moving them in their own subversion repository. This allows much quicker deployment with my new rails applications. Here&#8217;s how I do it: $ rails my_new_application $ cd my_new_application $ capify . Then I edit Capfile: load [...]]]></description>
			<content:encoded><![CDATA[	<p>I kept playing with Capistrano 2 after my last article, and I&#8217;ve refactored quite a bit my recipes, finally moving them in their own subversion repository. This allows much quicker deployment with my new rails applications. Here&#8217;s how I do it:</p>
<pre>
$ rails my_new_application
$ cd my_new_application
$ capify .
</pre>
	<p>Then I edit <em>Capfile</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'deploy'</span> <span style="color:#9966CC; font-weight:bold;">if</span> respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:namespace</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># cap2 differentiator</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'lib/recipes/site5'</span> <span style="color:#008000; font-style:italic;"># This is my site5 recipe</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'lib/recipes/medlar'</span> <span style="color:#008000; font-style:italic;"># The general use recipes</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'config/deploy'</span></pre></div></div>

	<p>The <em>site5</em> and <em>medlar</em> namespaces hold default configuration values, define some callbacks and the following tasks:</p>
<pre>
cap deploy:medlar:rails:freezer:edge   # Fetch Rails edge and puts it into sh...
cap deploy:medlar:rails:freezer:stable # Fetch Rails stable and puts it into ...
cap deploy:medlar:rails:link           # Links Rails to application/vendor
cap deploy:medlar:rails:update         # Updates the fetched version of rails.
	<p>cap deploy:site5:kill_dispatch_fcgi    # Kills Ruby instances on Site5<br />
cap deploy:site5:link_public_html      # Links public_html to current_path/pu...<br />
</pre></p>
	<p>Last but not least, here&#8217;s the simple, clean and elegant <em>deploy.rb</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;my_new_application&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;the_username&quot;</span>
&nbsp;
set <span style="color:#ff3333; font-weight:bold;">:repository</span>,  <span style="color:#996600;">&quot;repo_address&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/home/#{user}/apps/#{application}&quot;</span>
&nbsp;
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;server.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;server.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>,  <span style="color:#996600;">&quot;server.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span></pre></div></div>

	<p>Quite readable, isn&#8217;t it? <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
	<p>The recipes are available via anonymous subversion: <a href="https://svn1.hosted-projects.com/medlar/recipes/">https://svn1.hosted-projects.com/medlar/recipes/</a></p>
	<p>Enjoy and let me know if you found them useful.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Capistrano 2 Callbacks</title>
		<link>http://tempe.st/2007/08/capistrano-2-callbacks/</link>
		<comments>http://tempe.st/2007/08/capistrano-2-callbacks/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 09:09:28 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/08/capistrano-2-callbacks/</guid>
		<description><![CDATA[Converting the callbacks in my cap recipes to the new capistrano 2 format wasn&#8217;t as easy as I thought it would be. It turned out I had to use fully qualified task names in the after callback instead of the non-namespaced-names. Here&#8217;s a sample of working callbacks: namespace :deploy do after &#34;deploy:setup&#34;, &#34;deploy:sposivip:create_galleries&#34;, &#34;deploy:sposivip:freeze_rails&#34; after [...]]]></description>
			<content:encoded><![CDATA[	<p>Converting the callbacks in my cap recipes to the new capistrano 2 format wasn&#8217;t as easy as I thought it would be. It turned out I had to use fully qualified task names in the after callback instead of the non-namespaced-names.</p>
	<p>Here&#8217;s a sample of working callbacks:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  after <span style="color:#996600;">&quot;deploy:setup&quot;</span>, <span style="color:#996600;">&quot;deploy:sposivip:create_galleries&quot;</span>, <span style="color:#996600;">&quot;deploy:sposivip:freeze_rails&quot;</span>
  after <span style="color:#996600;">&quot;deploy:update&quot;</span>, <span style="color:#996600;">&quot;deploy:site5:link_public_html&quot;</span>, <span style="color:#996600;">&quot;deploy:sposivip:link_rails&quot;</span>, <span style="color:#996600;">&quot;deploy:sposivip:link_galleries&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

	<p>Here I have two callbacks. The first one runs after setup, creating shared paths and freezing rails in the shared directory, so I avoid having a copy on rails in each release.</p>
	<p>The second callback runs after deploy:update, so it will be called whenever I do a simple deploy or a cold deploy, it links back various directories in the shared path and it links the shared rails in vendor.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/08/capistrano-2-callbacks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Capistrano 2 on Site5</title>
		<link>http://tempe.st/2007/07/capistrano-2-on-site5/</link>
		<comments>http://tempe.st/2007/07/capistrano-2-on-site5/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 18:21:21 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Site5]]></category>

		<guid isPermaLink="false">http://tempe.st/2007/07/capistrano-2-on-site5/</guid>
		<description><![CDATA[I finally took the time to browse the capistrano 2 sources, and after reaching enlightenment I was able to write a deploy.rb file (yes I still use capify + deploy.rb instead of Capfile) that works really fine and really sweet on Site5. Without further ado, I introduce you to deploy.rb extreme Site5 version # Necessary [...]]]></description>
			<content:encoded><![CDATA[	<p>I finally took the time to browse the capistrano 2 sources, and after reaching enlightenment I was able to write a deploy.rb file (yes I still use capify + deploy.rb instead of Capfile) that works really fine and really sweet on Site5.</p>
	<p>Without further ado, I introduce you to deploy.rb <strong>extreme Site5 version</strong> <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Necessary to run on Site5</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
set <span style="color:#ff3333; font-weight:bold;">:group_writable</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Less releases, less space wasted</span>
set <span style="color:#ff3333; font-weight:bold;">:keep_releases</span>, <span style="color:#006666;">2</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># The mandatory stuff</span>
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;YOUR_APP_NAME&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;SSH_USERNAME&quot;</span>
&nbsp;
set <span style="color:#ff3333; font-weight:bold;">:repository</span>,  <span style="color:#996600;">&quot;URL_FOR_YOUR_REPOSITORY&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># SCM information</span>
set <span style="color:#ff3333; font-weight:bold;">:scm_username</span>, <span style="color:#996600;">&quot;SCM_USERNAME&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:scm_password</span>, <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span> CLI.<span style="color:#9900CC;">password_prompt</span> <span style="color:#996600;">&quot;SVN Password: &quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># This is related to site5 too.</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/home/#{user}/apps/#{application}&quot;</span>
&nbsp;
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;SERVERNAME&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;SERVERNAME&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>,  <span style="color:#996600;">&quot;SERVERNAME&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
&nbsp;
<span style="color:#008000; font-style:italic;"># In the deploy namespace we override some default tasks and we define</span>
<span style="color:#008000; font-style:italic;"># the site5 namespace.</span>
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC
    Deploys <span style="color:#9966CC; font-weight:bold;">and</span> starts a <span style="color:#996600;">`cold' application. This is useful if you have not <span style="color:#000099;">\</span>
    deployed your application before, or if your application is (for some <span style="color:#000099;">\</span>
    other reason) not currently running. It will deploy the code, run any <span style="color:#000099;">\</span>
    pending migrations, and then instead of invoking `</span>deploy:restart<span style="color:#996600;">', it will <span style="color:#000099;">\</span>
    invoke `deploy:start'</span> to fire up the application servers.
  <span style="color:#9900CC;">DESC</span>
  <span style="color:#008000; font-style:italic;"># NOTE: we kill public_html so be sure to have a backup or be ok with this application</span>
  <span style="color:#008000; font-style:italic;"># being the default app for the domain.</span>
  task <span style="color:#ff3333; font-weight:bold;">:cold</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    update
    site5::link_public_html
    site5::kill_dispatch_fcgi
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC
    Site5 version of restart task.
  <span style="color:#9900CC;">DESC</span>
  task <span style="color:#ff3333; font-weight:bold;">:restart</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    site5::kill_dispatch_fcgi
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  namespace <span style="color:#ff3333; font-weight:bold;">:site5</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    desc <span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC
      Links public_html to current_release<span style="color:#006600; font-weight:bold;">/</span>public
    DESC
    task <span style="color:#ff3333; font-weight:bold;">:link_public_html</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      run <span style="color:#996600;">&quot;cd /home/#{user}; rm -rf public_html; ln -s #{current_path}/public ./public_html&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    desc <span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>DESC
      Kills Ruby instances on Site5
    DESC
    task <span style="color:#ff3333; font-weight:bold;">:kill_dispatch_fcgi</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      run <span style="color:#996600;">&quot;skill -u #{user} -c ruby&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

	<p>May your deploys be merry and bright and I wish you all your applications be white <img src='http://tempe.st/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

 ]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2007/07/capistrano-2-on-site5/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

