<?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>Craft It Online!</title>
	<atom:link href="http://www.craftitonline.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.craftitonline.com</link>
	<description>He is no fool who gives what he cannot keep to gain what he cannot lose - christian martyr</description>
	<lastBuildDate>Mon, 01 Apr 2013 22:17:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
<image>
  <link>http://www.craftitonline.com</link>
  <url>http://www.craftitonline.com/favicon.ico</url>
  <title>Craft It Online!</title>
</image>
		<item>
		<title>Run Behat from PHPStorm</title>
		<link>http://www.craftitonline.com/2013/04/run-behat-from-phpstorm/</link>
		<comments>http://www.craftitonline.com/2013/04/run-behat-from-phpstorm/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 22:13:38 +0000</pubDate>
		<dc:creator>Luis Cordova</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.craftitonline.com/?p=3348</guid>
		<description><![CDATA[This is a nice trick I wanted to share, this one comes from a very known member of the symfony2 community, @elnur. He is the one who proposed a different folder structure for symfony2 projects. Now he comes to tell &#8230; <a href="http://www.craftitonline.com/2013/04/run-behat-from-phpstorm/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is a nice trick I wanted to share, this one comes from a very known member of the symfony2 community, <a href="http://elnur.pro">@elnur</a>. He is the one who proposed a different folder structure for symfony2 projects. Now he comes to tell us about how to setup and run behat from within PHPStorm IDE:</p>
<p>The technique uses the cmd+X console like command tool from PHPStorm</p>
<p>source: <a href="http://github.com/elnur">@elnur</a><br />
<a href="http://www.craftitonline.com/wp-content/uploads/2013/04/1nshUfaR.png"><img src="http://www.craftitonline.com/wp-content/uploads/2013/04/1nshUfaR-300x212.png" alt="1nshUfaR" width="300" height="212" class="aligncenter size-medium wp-image-3349" /></a></p>
<p>Enjoy behating!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftitonline.com/2013/04/run-behat-from-phpstorm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fabric Deploy Your Symfony2 App: Part I</title>
		<link>http://www.craftitonline.com/2013/02/fabric-deploy-your-symfony2-app-part-i/</link>
		<comments>http://www.craftitonline.com/2013/02/fabric-deploy-your-symfony2-app-part-i/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 23:49:39 +0000</pubDate>
		<dc:creator>Luis Cordova</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.craftitonline.com/?p=3339</guid>
		<description><![CDATA[Sometime ago I heard OpenSky deploys their app with fabric from @jwage, he had an article but I couldn&#8217;t make up the details since I was confused a bit by capifony. Now I know why they use it and here &#8230; <a href="http://www.craftitonline.com/2013/02/fabric-deploy-your-symfony2-app-part-i/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sometime ago I heard OpenSky deploys their app with fabric from @jwage, he had an article but I couldn&#8217;t make up the details since I was confused a bit by capifony. Now I know why they use it and here is the repo that we can improve together:</p>
<p>I improve this script from https://github.com/fabriceb/sfLive2011 and from jwage blog post http://jwage.com/post/31049115791/deploying-opensky-with-fabric which i did not remember but now that i look at it has some complementing things i will touch on the next part ii of this blog post.</p>
<p>Let&#8217;s install it from the mother ship <a href="https://github.com/cordoval/Symfony2Fabric" title="https://github.com/cordoval/Symfony2Fabric">https://github.com/cordoval/Symfony2Fabric</a>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php">pip install fabric</pre></td></tr></table></div>

<p>Let&#8217;s add fabfile.py to the root folder of our app:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php">from fabric<span class="sy0">.</span>api import <span class="sy0">*</span>
from fabric<span class="sy0">.</span>contrib<span class="sy0">.</span>files import exists
import os
from <a href="http://www.php.net/time"><span class="kw3">time</span></a> import <a href="http://www.php.net/strftime"><span class="kw3">strftime</span></a>
&nbsp;
repo <span class="sy0">=</span> <span class="st_h">'git@github:username/mysite.git'</span>
path <span class="sy0">=</span> <span class="st_h">'/var/www/mysite'</span>
env<span class="sy0">.</span>use_ssh_config <span class="sy0">=</span> <span class="kw4">True</span>
env<span class="sy0">.</span>sudo_user <span class="sy0">=</span> <span class="st_h">'www-data'</span>
&nbsp;
env<span class="sy0">.</span>hosts <span class="sy0">=</span> <span class="br0">&#91;</span><span class="st_h">'grace'</span><span class="sy0">,</span> <span class="st_h">'gospel'</span><span class="br0">&#93;</span>
<span class="co2"># check read-access to the keys, to be server-independent
</span>keys <span class="sy0">=</span> <span class="br0">&#91;</span><span class="st_h">'~/.ssh/id_rsa'</span><span class="br0">&#93;</span>
env<span class="sy0">.</span>key_filename <span class="sy0">=</span> <span class="br0">&#91;</span><a href="http://www.php.net/key"><span class="kw3">key</span></a> <span class="kw1">for</span> <a href="http://www.php.net/key"><span class="kw3">key</span></a> in keys <span class="kw1">if</span> os<span class="sy0">.</span>access<span class="br0">&#40;</span><a href="http://www.php.net/key"><span class="kw3">key</span></a><span class="sy0">,</span> os<span class="sy0">.</span>R_OK<span class="br0">&#41;</span><span class="br0">&#93;</span>
&nbsp;
<span class="co2"># this tags the sha deploy
</span>def tag_prod<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">:</span>
    tag <span class="sy0">=</span> <span class="st0">&quot;prod/<span class="es6">%s</span>&quot;</span> <span class="sy0">%</span> <a href="http://www.php.net/strftime"><span class="kw3">strftime</span></a><span class="br0">&#40;</span><span class="st0">&quot;%Y/%m-<span class="es6">%d</span>-%H-%M-%S&quot;</span><span class="br0">&#41;</span>
    local<span class="br0">&#40;</span><span class="st_h">'git tag -a %s -m &quot;Prod&quot;'</span> <span class="sy0">%</span> tag<span class="br0">&#41;</span>
    local<span class="br0">&#40;</span><span class="st_h">'git push --tags'</span><span class="br0">&#41;</span>
&nbsp;
def install<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">:</span>
    sudo<span class="br0">&#40;</span><span class="st_h">'mkdir -p '</span> <span class="sy0">+</span> path<span class="br0">&#41;</span>
    with cd<span class="br0">&#40;</span>path<span class="br0">&#41;</span><span class="sy0">:</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'git clone '</span> <span class="sy0">+</span> repo <span class="sy0">+</span> <span class="st_h">' .'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'composer install --dev'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'php app/console doctrine:database:create'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'php app/console doctrine:migrations:migrate --no-interaction'</span><span class="br0">&#41;</span>
&nbsp;
def update<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">:</span>
    with cd<span class="br0">&#40;</span>path<span class="br0">&#41;</span><span class="sy0">:</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'git remote update'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'git pull'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'composer install --dev'</span><span class="br0">&#41;</span>
        sudo<span class="br0">&#40;</span><span class="st_h">'php app/console doctrine:migrations:migrate --no-interaction'</span><span class="br0">&#41;</span>
<span class="co2">#        tag = run('git tag -l prod/* | sort | tail -n1')
</span><span class="co2">#        run('git checkout ' + tag)
</span>
def deploy<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">:</span>
    <span class="kw1">if</span> not exists<span class="br0">&#40;</span>path<span class="br0">&#41;</span><span class="sy0">:</span>
        install<span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co2">#    tag_prod()
</span>    update<span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
<span class="co2">#def rollback(num_revs=1):
</span><span class="co2">#    with cd(path):
</span><span class="co2">#        run('git fetch')
</span><span class="co2">#        tag = run('git tag -l prod/* | sort | tail -n' + str(1 + int(num_revs)) + ' | head -n1')
</span><span class="co2">#        run('git checkout ' + tag)</span></pre></td></tr></table></div>

<p>Thanks for your support, I hope to see you on Portland sflive! If you want to see me there please support me as it is very expensive :&#8217;(.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftitonline.com/2013/02/fabric-deploy-your-symfony2-app-part-i/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: www.craftitonline.com @ 2013-05-25 07:00:20 by W3 Total Cache -->