How to deploying a branch

152 views
Skip to first unread message

Eugenol

unread,
Jan 7, 2007, 8:20:24 PM1/7/07
to Capistrano
Hi

How to deploy a specific branch or tag or even a specific revision into
a capistrano release ?
The problem also is that I've setup the svn repository from the trunk
(like everybody does I guess) with:

set :repository,
Proc.new { "--username \\"#{svn_user}\\" " +
"--password \\"#{svn_password}\\" " +
"http://svn.foo.com/#{application}/trunk/" }

Thanks for your help

Charles Brian Quinn

unread,
Jan 7, 2007, 9:06:27 PM1/7/07
to capis...@googlegroups.com
For a client, we altered the repository line to read:

set :repository,
"https://svn.server.com/#{application}/tags/#{ENV['DEPLOY_VERSION']}"

so now it is deployed with:

cap deploy DEPLOY_VERSION=1.2.5

hope that helps

--
Charles Brian Quinn
self-promotion: www.seebq.com
highgroove studios: www.highgroove.com
slingshot hosting: www.slingshothosting.com

Ruby on Rails Bootcamp at the Big Nerd Ranch
Intensive Ruby on Rails Training:
http://www.bignerdranch.com/classes/ruby.shtml

Eugenol

unread,
Jan 8, 2007, 5:32:57 AM1/8/07
to Capistrano
Nice. It gave me this idea:

if ENV['TAG']
deploy_version = "tags/#{ENV['TAG']}"
elsif ENV['BRANCH']
deploy_version = "branches/#{ENV['BRANCH']}"
else
deploy_version = "trunk/"
end


set :application, "foo"

set :svn_password,
Proc.new { Capistrano::CLI.password_prompt('SVN Password: ') }

set :repository,
Proc.new { "--username \\"#{svn_user}\\" " +
"--password \\"#{svn_password}\\" " +

"http://svn.foo.com/#{application}/#{deploy_version}" }

Bryan Liles

unread,
Jan 8, 2007, 7:16:57 AM1/8/07
to capis...@googlegroups.com

On Jan 7, 2007, at 9:06 PM, Charles Brian Quinn wrote:

>
> For a client, we altered the repository line to read:
>
> set :repository,
> "https://svn.server.com/#{application}/tags/#{ENV['DEPLOY_VERSION']}"
>
> so now it is deployed with:
>
> cap deploy DEPLOY_VERSION=1.2.5
>
> hope that helps
>

> On 1/7/07, Eugenol <eug...@gmail.com> wrote:
>>
>> Hi
>>
>> How to deploy a specific branch or tag or even a specific revision
>> into
>> a capistrano release ?
>> The problem also is that I've setup the svn repository from the trunk
>> (like everybody does I guess) with:
>>
>> set :repository,
>> Proc.new { "--username \\"#{svn_user}\\" " +
>> "--password \\"#{svn_password}\\" " +
>> "http://svn.foo.com/#{application}/trunk/" }
>>
>> Thanks for your help
>>
>>
>> >


Capistrano supports setting variables on the command line using the -
S command. I have something like the following in all my deploy.rb:

===
set :stage, "staging" unless variables[:stage]

case stage
when "staging"
set :domain, "app.staging"
set :repository, "http://svn/app/trunk" unless variables[:repo]
set :rails_env, "staging"
set :app_server, "staging"
when "production"
set :domain, "app.com"
set :repository, "http://svn/app/tags/2007010801" unless variables
[:repo]
set :rails_env, "production"
set :app_server, "prod"
end

#.... the rest of deploy.rb
===

As part of preparing a new release, I always update the repository
tag in the production stanza. This also makes it a conscious effort
to deploy to production.

Reply all
Reply to author
Forward
0 new messages