0
@@ -10,16 +10,26 @@ trace = false
0
scm_options = {:interactive => true}
0
- opts.banner = "usage: cruise add <project-name> --url <URL> [subversion options]"
0
+ opts.banner = "usage: cruise add <project-name> --svn-url <URL> [subversion options]"
0
+ opts.banner << "\n cruise add <project-name> --git-url <URL> [git options]"
0
- opts.on("-
u", "--url url", String,
0
+ opts.on("-
s", "--svn-url url", String,
0
"The subversion url for the project (eg. svn://rubyforge.org/var/svn/cruisecontrolrb)") do |v|
0
+ scm_options[:svn] = true
0
+ opts.on("-g", "--git-url url", String,
0
+ "The git url for the project (eg. git://github.com/benburkert/cruisecontrolrb.git)") do |v|
0
+ scm_options[:git] = true
0
opts.on("--username username", String, "Specify a username for source control") { |v| scm_options[:username] = v }
0
opts.on("--password password", String, "Specify a password for source control") { |v| scm_options[:password] = v }
0
+ opts.on("-b", "--branch", String, "Specify a branch to track(git only)") { |v| scm_options[:branch] = v}
0
opts.on('-t', '--trace', 'Print out exception stack traces') { trace = true }
0
puts "Adding project '#{project_name}' (this may take a while)..."
0
- require RAILS_ROOT + "/config/environment"
0
- source_control = Subversion.new(scm_options)
0
- project = Project.new(project_name, source_control)
0
- projects = Projects.load_all
0
- if source_control.url =~ /^svn\+ssh\:\/\//
0
+ require RAILS_ROOT + "/config/environment"
0
+ if scm_options.has_key?(:svn)
0
+ source_control = Subversion.new(scm_options)
0
+ elsif scm_options.has_key?(:git)
0
+ source_control = Git.new(scm_options)
0
+ raise "Unsupported SCM"
0
+ project = Project.new(project_name, source_control)
0
+ projects = Projects.load_all
0
+ if source_control.url =~ /^svn\+ssh\:\/\//
0
puts "IMPORTANT!!! - It looks like you are connecting to your repository with an svn+ssh connection. " +
0
"For cruise to build this project, you need to have set up authentication caching for ssh, see this article"
0
puts " http://subversion.tigris.org/faq.html#ssh-auth-cache"
Comments
No one has commented yet.