<?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>brettdargan.com &#187; deployment</title>
	<atom:link href="http://brettdargan.com/blog/tag/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettdargan.com/blog</link>
	<description>&#955; Thoughts and rants</description>
	<lastBuildDate>Fri, 28 May 2010 01:35:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Simpler Serverside Application Deployment and Management</title>
		<link>http://brettdargan.com/blog/2006/07/25/simpler-serverside-application-deployment-and-management/</link>
		<comments>http://brettdargan.com/blog/2006/07/25/simpler-serverside-application-deployment-and-management/#comments</comments>
		<pubDate>Tue, 25 Jul 2006 01:15:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=73</guid>
		<description><![CDATA[Why aren't my release notes to sysadmins and testers: sudo yum install mypkgname Which downloads mypkgname from &#60;sys&#124;int&#124;uat&#124;prod&#62; yum repository with all of it's dependencies. That obviously wouldn't always be possible, but it is achievable with only a little pain . Use RPM for managing components of your System RPM is not ideally suited to [...]]]></description>
			<content:encoded><![CDATA[<p>Why aren't my release notes to sysadmins and testers:<br />
sudo yum install <em>mypkgname</em></p>
<p>Which <em>downloads mypkgname</em> <b>from &lt;sys|int|uat|prod&gt; yum repository with all of it's dependencies</b>. </p>
<p>That obviously <em>wouldn't always be possible</em>, but it is achievable with only a little pain <img src='http://brettdargan.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<h4>Use <a href="http://www.rpm.org/">RPM</a> for managing components of your System</h4>
<p><a href="http://www.rpm.org/">RPM</a> is <b>not ideally suited</b> to deploying java applications and all of it's dependencies, but <b>it can work</b>.</p>
<p>I've used it to  <a href="http://activemq.org">package up an installation of activemq</a>, with my application config and start/stop scripts.<br />
This was then extended to have ant build it so we could eventually have cruise create rpm artifacts for a project which could eventually get automatically sent to a <a href="http://linux.duke.edu/projects/yum/">yum repository</a>.</p>
<p><em><a href="http://www.rpm.org/">RPM</a> is not that great</em> but when you have to wrestle with <a href="http://www.redhat.com">RedHat AS</a> atleast it gives us
<ul>
<li>Dependency Management. Requires that <a href="http://dev.mysql.com">mysql</a> >= 5.0 must be installed. </li>
<li>Hooks for pre/post install/uninstall Scripts. %postin let me create a os user if required, set appropriate permissions, create a database, db user, add tables and insert data. </li>
<li>Ability to <a href="http://www.rpm.org/max-rpm/ch-rpm-reloc.html">relocate the package</a> on installation</li>
</ul>
<p><a href="http://www.phy.duke.edu/~rgb/General/yum_article/yum_article/node14.html">Creating  yum repositories sounds easy</a>, but I haven't gotten to this yet.</p>
<h4>What to do</h4>
<ol>
<li>Create your <a href="http://genetikayos.com/code/repos/rpm-tutorial/trunk/rpm-tutorial.html">~/.rpmmacros file</a></li>
<li><a href="http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html">Create a specification file, don't forget it will has access to some of it's own types of variables that are defined in .rpmmacros file.</a></li>
<li>package up your application of choice in a mypkgname-version.tar.gz. This is your main input into rpm, Source0: in your spec file must exactly match this file</li>
<li>rpm -bb mypkgname.spec</li>
<li>check your pkg info with: rpm -qpi mypkgname-version-noarch.rpm and your list of files with rpm -qpl mypkgname-version-noarch.rpm.</li>
<li>sudo rpm -i mypkgname-version-noarch.rpm</li>
</ol>
<h4>Tips</h4>
<ol>
<li>Understand <a href="http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html">%files</a> .I found it easier to build my own file.list, by using %files -f file.list. Defaulting attributes with %defattr(-,name,group) and %config to specify your config files are good to know about. </li>
<li>You don't have to use the root owned default database, you can specify your own with the --dbpath option</li>
<li><a href="http://www-128.ibm.com/developerworks/library/l-rpm3.html">How can you tell if a package is being installed or updated?</a><br />
$1 of the scriplets (%pre, %postin...) contain the number of pkg's affected, so during an update you affect 2 pkgs, as it is an uninstall, followed by an install operation.</li>
<li><a href="http://www.rpm.org/max-rpm/s1-rpm-specref-scripts.html">Scriptlets share the same environment</a>, but that environment is <em>special</em>. We had issues running pre-packaged scripts that depended on env variables setup in .bashrc becaused it exited if it wasn't an interactive shell. ie. [ -z $PS1 ] </li>
<li>Keep multiple copies of ~/.rpmmacros files and replace the one you are interested in</li>
<li>If you are packaging <a href="http://www.ruby-lan.org">ruby</a>, <a href="http://www.python.org">python</a> or <a href="http://java.sun.com">java</a> applications, then specify it as non architecture specific</li>
<li><a href="http://www.rpm.org/max-rpm/ch-rpm-reloc.html">Make it Relocatable</a> if possible</li>
<li>Someone had a problem with BuildArch: noarch on FC4 x86-64, that noarch was not recognised as a valid architecture. We needed to add a line to some file in /var/lib??. Moral of the story is to try not to use debian based distro instead.</li>
</ol>
<h4>If you know almost nothing about <a href="http://www.rpm.org/">RPM</a></h4>
<ul>
<li><a href="http://www.rpm.org/">RPM</a> can be used to manage src (c) or binary rpms. </li>
<li>It works by unextracting a tar of the source/binary then building and executing <a href="http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html">scriptlets</a> at the right moments.</li>
<li>configuration files, identified by %config, like /etc/mypkgname are renamed when you erase a package to mypkgname.conf.rpmsave.</li>
<li><a href="http://www.rpm.org/max-rpm/ch-rpm-reloc.html">Relocatable pkgs</a> require all your packaged files to have the same prefix.</li>
</ul>
<p>Thanks to co-conspirators Ajit George, Sam Jordan, Peter Klein, <a href="http://twasink.net/blog/">Robert Watkins</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Simpler+Serverside+Application+Deployment+and+Management+http%3A%2F%2Ftinyurl.com%2F5ubczb5" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Simpler+Serverside+Application+Deployment+and+Management+http%3A%2F%2Ftinyurl.com%2F5ubczb5" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2006/07/25/simpler-serverside-application-deployment-and-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

