Edgar Gonzalez
2006-Jan-28 16:16 UTC
[Rails] Switchtower different svn repo urls from my local box and my shared hosting
I got problems running switchtower 0.10.0 when I try to run "rake
deploy"
from my local box (windows) to my shared hosting
If I set the repository to (deploy.rb):
set :repository, "file:///home/[my_user]/repo/[my_app]/trunk"
My local box (windows) can''t reach the subversion repository located in
site5
If I set the repository to:
set :repository,
"svn+ssh://[my_user]@[my_site]/home/[my_user]/repo/[my_app]/trunk/"
I got a "permission denied" when svn run in my shared hosting
How do you deal with this?
The workaround I found was:
1. Leave the :repository property in deploy.rb to file:// syntax.
set :repository, "file:///home/[my_user]/repo/[my_app]/trunk"
2.Define a new property :repository_from_dev in deploy.rb to svn+ssh://
syntax
set :repository_from_dev,
"svn+ssh://[my_user]@[my_site]/home/[my_user]/repo/[my_app]/trunk/"
3. Modify the lib/tasks/switchtower.rake file in order to change the
switchtower behavior, adding this line:
# ======================================================# Extension to deploy to
site5
# ======================================================require
''switchtower/scm/subversion''
module SwitchTower
module SCM
class Subversion
def latest_revision
configuration.logger.debug "querying latest revision..."
unless
@latest_revision
#repo = configuration.repository
repo = configuration.repository_from_dev
puts "usando repository_from_dev: #{repo}"
until @latest_revision
match = svn_log(repo).scan(/r(\d+)/).first
@latest_revision = match ? match.first : nil
if @latest_revision.nil?
# if a revision number was not reported, move up a level in the
path
# and try again.
repo = File.dirname(repo)
end
end
@latest_revision
end
end
end
end
Now "rake deploy" works fine
Any suggestions? maybe another approach?
Thx in advanced
--
Edgar Gonz?lez Gonz?lez
E-mail: edgargonzalez@gmail.com
http://lacaraoscura.com
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060128/a90c6d5c/attachment-0001.html
Jamis Buck
2006-Jan-29 02:55 UTC
[Rails] Switchtower different svn repo urls from my local box and my shared hosting
On Jan 28, 2006, at 10:16 AM, Edgar Gonzalez wrote:> I got problems running switchtower 0.10.0 when I try to run "rake > deploy" from my local box (windows) to my shared hosting > > If I set the repository to (deploy.rb): > set :repository, " file:///home/[my_user]/repo/[my_app]/trunk" > > My local box (windows) can''t reach the subversion repository > located in site5 > > If I set the repository to: > > set :repository, "svn+ssh://[my_user]@[my_site]/home/[my_user]/repo/ > [my_app]/trunk/" > > I got a "permission denied" when svn run in my shared hostingVery odd! I don''t understand why you''d get the permission denied, especially given your workaround, below. Feel free to email me off- list and we can try and troubleshoot it a bit. - Jamis> > How do you deal with this? > > The workaround I found was: > > 1. Leave the :repository property in deploy.rb to file:// syntax. > set :repository, "file:///home/[my_user]/repo/[my_app]/trunk" > 2.Define a new property :repository_from_dev in deploy.rb to svn > +ssh:// syntax > set :repository_from_dev, "svn+ssh://[my_user]@[my_site]/home/ > [my_user]/repo/[my_app]/trunk/" > 3. Modify the lib/tasks/switchtower.rake file in order to change > the switchtower behavior, adding this line: > > # ======================================================> # Extension to deploy to site5 > # ======================================================> require ''switchtower/scm/subversion'' > > module SwitchTower > module SCM > class Subversion > def latest_revision > configuration.logger.debug "querying latest revision..." > unless @latest_revision > #repo = configuration.repository > repo = configuration.repository_from_dev > puts "usando repository_from_dev: #{repo}" > until @latest_revision > match = svn_log(repo).scan(/r(\d+)/).first > @latest_revision = match ? match.first : nil > if @latest_revision.nil? > # if a revision number was not reported, move up a > level in the path > # and try again. > repo = File.dirname(repo) > end > end > @latest_revision > end > end > end > end > > Now "rake deploy" works fine > > Any suggestions? maybe another approach? > Thx in advanced > > -- > Edgar Gonz?lez Gonz?lez > E-mail: edgargonzalez@gmail.com > http://lacaraoscura.com > -- > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails