Search Results

You searched for "medlar". Here are the results:

About Me

Entepreneur, coder, tech enthusiast, geek, gamer. This blog is home to Giovanni Intini (aka intinig)’s tempest of thoughts.

Cofounder of Medlar and Mikamai, partner in Nimboo, while not busy working, coding, enthusiasting about tech, geeking, or playing, he likes to post on this blog.

More Capistrano 2 goodies: A Radiant recipe library

This is a followup to “A Couple of Capistrano 2 Recipes Libraries”:http://tempe.st/2007/09/a-couple-of-capistrano-2-recipes-libraries

It’s official: I am a Capistranoholist, and I can’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’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.

As usual you can get them from the recipes repository .

After you get the recipes load them from Capfile:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
load 'lib/recipes/medlar'
load 'lib/recipes/radiant'

Now you will have one more callback and an overridden deploy:cold task:

  after "deploy:migrate", "deploy:radiant:migrate:extensions"
 
  desc "Overridden deploy:cold for Radiant."
  task :cold do
    update
    "radiant:bootstrap"
    start
  end

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.

If you don’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.

A couple of capistrano 2 recipes libraries

I kept playing with Capistrano 2 after my last article, and I’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’s how I do it:

$ rails my_new_application
$ cd my_new_application
$ capify .

Then I edit Capfile:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator
 
load 'lib/recipes/site5' # This is my site5 recipe
load 'lib/recipes/medlar' # The general use recipes
 
load 'config/deploy'

The site5 and medlar namespaces hold default configuration values, define some callbacks and the following tasks:

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.
	

cap deploy:site5:kill_dispatch_fcgi # Kills Ruby instances on Site5
cap deploy:site5:link_public_html # Links public_html to current_path/pu...

Last but not least, here’s the simple, clean and elegant deploy.rb:

set :application, "my_new_application"
set :user, "the_username"
 
set :repository,  "repo_address"
set :deploy_to, "/home/#{user}/apps/#{application}"
 
role :app, "server.com"
role :web, "server.com"
role :db,  "server.com", :primary => true

Quite readable, isn’t it? :)

The recipes are available via anonymous subversion: https://svn1.hosted-projects.com/medlar/recipes/

Enjoy and let me know if you found them useful.

Projects

Here’s a summary of the open source projects I’ve been working on lately:

Language Redirect, an extension for Radiant CMS

While looking through my email I found an email that helped me remember that a couple of months ago, while working on StudioCarone.it I wrote (ported) a simple extension to the wonderful Radiant CMS, language_redirect_extension. The usage is straightforward, just check it out via svn into your extensions directory.

The rest of the extension works like the old language redirect behavior used to do. Drop me a mail at info AT tempe DOT st if you have any problems or if you need more detailed instructions.