Warning: Missing argument 2 for wpdb::prepare(), called in /home/psq/nanorails.com/wp-content/themes/canvas/functions/admin-functions.php on line 947 and defined in /home/psq/nanorails.com/wp-includes/wp-db.php on line 1154
git, submodules and Capistrano | nanoRAILS

git, submodules and Capistrano

If you use git submodules, as git-rails does, and want to use Capistano, you’ll need to patch patch Capistrano (lib/capistano/recipes/deploy/scm/git.rb) to make sure your submodules get included.

        def checkout(revision, destination)
          git      = command

          branch   = head

          fail "No branch specified, use for example 'set :branch, \"origin/master\"' in your deploy.rb" unless branch

          if depth = configuration[:git_shallow_clone]
            execute  = "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination} && "
            execute  = "#{git} clone #{configuration[:repository]} #{destination} && "

          execute += "cd #{destination} && #{git} checkout -b deploy #{branch}"

          if submodules = configuration[:git_enable_submodules]
            execute += " && git-submodule init &&"
            execute += "git-submodule update"


then define this in your deploy.rb:

set :git_enable_submodules,1

Or you can use the trunk version (post 2.1), which includes that support already.

Tags: ,

One Response to “git, submodules and Capistrano”

  1. Alicia February 18, 2008 at 5:47 am #

    I used this with Capistrano, i was very successful! I made the codes from scratch and it worked perfectly.