Commit Diff


commit - c53f274150a3ce7d098737613aa2c9d1c926d8d5
commit + 8bf0b47663c6731c35494907dd54043dabc901c6
blob - 47867de2eee582f8eafa8073871759fb3e7b7810
blob + 079482315b6aa35a448de05005d69dacc1c82032
--- gitgot-deploy.pl
+++ gitgot-deploy.pl
@@ -6,6 +6,7 @@ my $config={
 	gitgotUser=>'gitgot',
 	gitDir=>'/var/git',
 	gotwebDir=>'/var/www/got/public',
+	cloneurlBase=>"git://got.ircnow.org",
 };
 # Sync changes from stageDir to the webdir
 opendir (my $DH, $config->{stageDir}) 
@@ -38,6 +39,13 @@ while (my $user = readdir($DH)) {
 				});
 				warn "rsync failed $prefixName\n$!\n" if ($rv != 0);
 			}
+			# Create a gloneurls file with the default clone url if it isn't set
+			my $cloneurl = $config->{gitDir} . "/$prefixName/cloneurl";
+			unless (-e $cloneurl) {
+				open(my $oDH, ">$cloneurl")
+					or die "Can't write to $cloneurl : $!";
+				print $oDH $config->{cloneurlBase} . "/$prefixName";
+			}
 		}
 	}
 }