Commit 793e3b76 authored by Leigh B Stoller's avatar Leigh B Stoller

For repo-based profiles, form an ssh url from the http url, and add a

command to set the push url.
parent be30a2a7
......@@ -56,6 +56,7 @@ use English;
use Data::Dumper;
use File::Basename;
use File::Temp qw(tempfile :mktemp tmpnam :POSIX);
use URI::URL;
use overload ('""' => 'Stringify');
# Configure variables
......@@ -1213,7 +1214,19 @@ sub SetRepo($$$$$$)
$command .= "&& git branch -ft $branchname origin/$branchname" .
"&& git checkout -B $branchname HEAD ";
}
$command .= "&& sudo chown -R $owner .";
$command .= "&& sudo chown -R $owner . ";
#
# Generate an SSH url and make that the push url so users can easily
# push up (assuming they have the proper credentials loaded).
#
my $url = new URI::URL $repourl;
my $host = $url->host();
my ($org,$project) = ($url->path() =~ /^\/([^\/]+)(\/.*)$/);
if (defined($org) && defined($project)) {
my $sshurl = "git\@${host}:${org}${project}";
$command .= "&& git remote set-url --push origin '$sshurl'";
}
foreach my $node (GeniXML::FindNodes("n:node", $rspec)->get_nodelist()) {
my $service;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment