Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
sharing a few recipes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
S. Brent Faulkner  
View profile  
 More options Aug 29 2008, 11:09 am
From: "S. Brent Faulkner" <bre...@unwwwired.net>
Date: Fri, 29 Aug 2008 08:09:56 -0700 (PDT)
Local: Fri, Aug 29 2008 11:09 am
Subject: sharing a few recipes
I'm posting a few "recipes" for capistrano that I've found useful.
These are all working on a production system using Capistrano 2.4.3. I
welcome and criticism/suggestions of the techniques... just be
nice ;-)

Cheers.

1. Using github with capistrano:

- if you're using a public repository...

> set :scm, :git
> set :repository, "git://github.com/user/#{application}.git"

- if you're using a private repository, create a keypair and add the
public key into your repository's deploy keys

> set :scm, :git
> set :repository, "g...@github.com:user/#{application}.git"

2. Keeping database.yml outside of my source repository:

- after running deploy:setup, create a shared/config/database.yml and
link to it with the following task

3. Depending on non-gem libraries (e.g. ruby-odbc)...

- add the following mixin to your deploy.rb (and replace "odbc" with
whatever library you depend on)

> # extend capistrano's remote dependency checking to handle libraries
> require 'capistrano/recipes/deploy/remote_dependency'
> Capistrano::Deploy::RemoteDependency.class_eval do
>   def lib(name, options = {})
>     @message ||= "library `#{name}' could not be found"
>     try("ruby -r#{name} -etrue 2>&1", options)
>     self
>   end
> end

> ...

> depend :remote, :lib, "odbc"

4. Changing the current branch for a remote cache when using
subversion...

- when deploying using subversion "set :deploy_via, :remote_cache" the
branch has to be the same as it was on the preceding deployment... you
can work around this by changing how capistrano gets the latest source
from subversion... so now you can cahnge the value of :repository to a
new branch when you deploy and subversion will deal with it

> require 'capistrano/recipes/deploy/scm/subversion'
> # use switch instead of update to sync the subversion repository (so that it handles a possible repository change)
> Capistrano::Deploy::SCM::Subversion.class_eval do
>   def sync(revision, destination)
>     scm :switch, verbose, authentication, "-r#{revision}", repository, destination
>   end
> end

5. Rollback the database schema when rolling back code...

- sometimes changes to the schema (via migrations) render different
versions of your application incompatibile with the schema requiring
the database (structure) to be rolled back if the code is rolled back


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
S. Brent Faulkner  
View profile  
 More options Aug 30 2008, 12:41 am
From: "S. Brent Faulkner" <bre...@unwwwired.net>
Date: Fri, 29 Aug 2008 21:41:35 -0700 (PDT)
Local: Sat, Aug 30 2008 12:41 am
Subject: Re: sharing a few recipes
Sorry about the formatting of my post guys... you may have to click on
- Show quoted text - to see some of the post due to my choice of "> "
to indicate my code snippets. Google was too smart for it's own good
in this case...

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google