<?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>Sébastien Barbieri's blog &#187; svn</title>
	<atom:link href="http://blog.sbw.be/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sbw.be</link>
	<description>My life, my work, my projects</description>
	<lastBuildDate>Sat, 24 Dec 2011 00:12:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Open Dojo v1.0</title>
		<link>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/</link>
		<comments>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 17:03:53 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[OpenDojo]]></category>
		<category><![CDATA[opendojo]]></category>
		<category><![CDATA[phing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=475</guid>
		<description><![CDATA[Subject list for an open dojo / bbq session As Jedi phpunit and code coverage phing deployment svn and continuous integration As Padawan Working agile Scrum Now let&#8217;s decide a timeline]]></description>
			<content:encoded><![CDATA[<p>Subject list for an open dojo / bbq session</p>
<p>As Jedi</p>
<ul>
<li>phpunit and code coverage</li>
<li>phing deployment</li>
<li>svn and continuous integration</li>
</ul>
<p>As Padawan</p>
<ul>
<li>Working agile</li>
<li>Scrum</li>
</ul>
<p>Now let&#8217;s decide a timeline</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2011/04/06/open-dojo-v1-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Subversion backup &amp; restore</title>
		<link>http://blog.sbw.be/2010/10/07/subversion-backup-restore/</link>
		<comments>http://blog.sbw.be/2010/10/07/subversion-backup-restore/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 20:39:02 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=435</guid>
		<description><![CDATA[Get it first of all you need the best script ever made to backup subversion: the one provided with! Get it here: http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in This script needs to be modified replace: # Path to svnlook utility svnlook = r"@SVN_BINDIR@/svnlook" # Path to svnadmin utility svnadmin = r"@SVN_BINDIR@/svnadmin" with: # Path to svnlook utility svnlook = r"/usr/bin/svnlook" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Get it</strong></p>
<p>first of all you need the best script ever made to backup subversion: the one provided with!</p>
<p>Get it here: <a href="http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in">http://svn.apache.org/repos/asf/subversion/trunk/tools/backup/hot-backup.py.in</a></p>
<p>This script needs to be modified</p>
<p>replace:</p>
<p><code lang="python"><br />
# Path to svnlook utility<br />
svnlook = r"@SVN_BINDIR@/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"@SVN_BINDIR@/svnadmin"<br />
</code></p>
<p>with:</p>
<p><code lang="python"><br />
# Path to svnlook utility<br />
svnlook = r"/usr/bin/svnlook"<br />
# Path to svnadmin utility<br />
svnadmin = r"/usr/bin/svnadmin"<br />
</code></p>
<p>or your appropriate svnlook and svnadmin path</p>
<p>Then you need to check that your user can modify files</p>
<p>once it&#8217;s verified let&#8217;s create a repository to store backup &#8216;/backup&#8217; for instance and create your directory structure there</p>
<p><strong>Test it</strong></p>
<p>test the whole stuff<br />
<code><br />
./hot-backup.py --archive-type=bz2 --num-backups=45 /svn/TEST_REPO/ /backup/subversion/test_repo/<br />
</code></p>
<p>you should get something like TEST_REPO-2.tar.bz2 (here minus 2 means revision n°2)</p>
<p><strong>Schedule it</strong></p>
<p>If you want to run it daily, put it in a cron such as a daily job</p>
<p>As I have multiple repositories here is my script</p>
<p><code lang="bash"><br />
#!/bin/bash<br />
NUMBACKUP=15<br />
for i in `ls /svn/`<br />
do<br />
        mkdir -p /backup/svn/$i<br />
        ./hot-backup.py --archive-type=bz2 --num-backups=$NUMBACKUP /svn/$i /backup/svn/$i<br />
done<br />
</code></p>
<p><strong>Restore it</strong></p>
<p>Ok that&#8217;s nice, you got a backup, but unless you can restore it, it&#8217;s useless!</p>
<p>So here is how to restore it:</p>
<ol>
<li>tar -xjvf /backup/svn/TEST/test-2.tar.bz2</li>
<li>cp -R /backup/svn/TEST/TEST-2/ /svn/TEST/</li>
</ol>
<p>and&#8230; that&#8217;s it</p>
<p>of course at the end of your backup script I recommend to move everything to another computer, because you will probably need it when disk crashes ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2010/10/07/subversion-backup-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#web #continuous #integration: #Autodeploy on #commit</title>
		<link>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/</link>
		<comments>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 20:13:13 +0000</pubDate>
		<dc:creator>Sébastien Barbieri</dc:creator>
				<category><![CDATA[freelance]]></category>
		<category><![CDATA[truc de g33k]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.sbw.be/?p=341</guid>
		<description><![CDATA[Option 1 In 4 steps svn commit to the repository the pre-commit hook will check the code with svnlook and will validate the commit message (based on regexp such has bug# &#8230;, text minimal size&#8230;) the post-commit hook will try to connect to the ITT (Integration Team Testing) if you have the good acronym, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Option 1</strong></p>
<div id="attachment_342" class="wp-caption aligncenter" style="width: 1011px"><a href="http://blog.sbw.be/wp-content/uploads/2009/12/PostCommitAutoDeploy.png"><img src="http://blog.sbw.be/wp-content/uploads/2009/12/PostCommitAutoDeploy.png" alt="post commit auto deploy" title="PostCommitAutoDeploy" width="1001" height="449" class="size-full wp-image-342" /></a><p class="wp-caption-text">post commit auto deploy</p></div>
<p>In 4 steps</p>
<ol>
<li><strong>svn commit</strong> to the repository</li>
<li>the <strong>pre-commit hook</strong> will check the code with <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.tk.svnlook">svnlook</a> and will validate the commit message (based on regexp such has bug# &#8230;, text minimal size&#8230;)</li>
<li>the <strong>post-commit hook</strong> will try to connect to the ITT (Integration Team Testing) <em>if you have the good acronym, I&#8217;ll update</em></li>
<li>once connected a script should be launched (and forgot &#038;;) This script should:
<ul>
<li><strong>Do a svn checkout locally so the code could be tested (in /var/www &#8230;)</strong>. <em>This method has several drawback:  instability of the site while exporting, destruction of ITT generated file (if any)&#8230;</em></li>
<li>Do a<strong> svn checkout in a temporary directory</strong> (/export/&lt;projectname&gt;) and then use <strong>rsync</strong> to do a fast compare and copy changes only without deleting the existing, excluding the .svn folders</li>
<li>Do a<strong> svn export in a temporary directory</strong> (/tmp/&lt;projectname&gt;) and then use the same <strong>rsync</strong> than above but this time you don&#8217;t have to exclude the .svn</li>
</ul>
<p>The fastest is the second one (svn checkout -> /export/&lt;projectname&gt; + rsync &#8211; .svn folders)
 </li>
</ol>
<p><strong>Option 2</strong></p>
<p>There is another <strong>alternative</strong> if you have space and sufficient right on your <strong>svn repository</strong>: the svn export/svn checkout is done locally and you use rsync to <strong>deploy</strong> the site on the ITT server.</p>
<p><strong>Option 3</strong></p>
<p>There is a third <strong>alternative</strong> if you have one more server (a synchro server) that will be used to store the svn export (at least the last one and maybe 2-3 version before) and that will take care of the rsync between one of its local checkout/export and the ITT server.</p>
<p><strong>Conclusion</strong></p>
<p>The last option has the big advantage of being a intermediate repository that can deploy any revision to any server &#8230; but that&#8217;s another paper.</p>
<p>I used the 3 options, and the first one (the simplest/cheapest) is very easy to maintain and to set up, so it&#8217;s a must have for team < 15 &#8230; bigger team may think about the other options but will have to put additional resources to design the whole deployment system.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sbw.be/2009/12/11/web-continuous-integration-auto-deploy-on-commit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

