buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danny O'Connor <danny.ocon...@propylon.com>
Subject SVN credentials for release task
Date Fri, 27 Nov 2009 11:31:19 GMT
Hi All,

When you're using buildr with the hudson continuous integration server, 
the 'release' task won't work because buildr needs a credential for svn. 
  This would probably happen in any situation where you don't cached 
authentication for svn servers.

A quick patch is to allow svn username and password be set as 
environment variables like so:

# Modified to allow usernames/passwords for svn
module Buildr
   module Svn
   module_function
     def svn(*args)
       if ENV["svn_username"] and ENV["svn_password"] then
         svn_command = "svn --username #{ENV["svn_username"]} --password 
#{ENV["svn_password"]} #{args.shift} #{args.map { |arg| arg.inspect 
}.join(' ')}"
       else
         svn_command = "svn #{args.shift} #{args.map { |arg| arg.inspect 
}.join(' ')}"
       end
       output = `#{svn_command}`
       fail "SVN command failed with status #{$?.exitstatus}" unless 
$?.exitstatus == 0
       return output
     end
   end
end


I'm not sure if this is entirely correct though.

Regards,
Danny.


Mime
View raw message