commit c53f274150a3ce7d098737613aa2c9d1c926d8d5 from: Izzy Blacklock date: Tue May 23 03:44:14 2023 UTC Fixed bug preventing git clone. git clone relied on the repo bing in /var/git/ so made that the first destination then an rsync to the /var/www/got/public/ commit - 9d3839a0be3481bf65cf46162be4ac4d9eedffcf commit + c53f274150a3ce7d098737613aa2c9d1c926d8d5 blob - aeaaaabf41e969c684a1cd33480c06ed8ef043f4 blob + 47867de2eee582f8eafa8073871759fb3e7b7810 --- gitgot-deploy.pl +++ gitgot-deploy.pl @@ -4,6 +4,7 @@ use warnings; my $config={ stageDir=>'/var/gitgot', gitgotUser=>'gitgot', + gitDir=>'/var/git', gotwebDir=>'/var/www/got/public', }; # Sync changes from stageDir to the webdir @@ -24,7 +25,7 @@ while (my $user = readdir($DH)) { # rsync the contents of it. my @stat=stat($config->{stageDir} . "/$user/$repo"); my $prefixName="$user-$repo"; - my $dst=qq(/$config->{gotwebDir}/$prefixName/); + my $dst=qq(/$config->{gitDir}/$prefixName/); mkdir $dst,$stat[2]; #stat[2] is mode of original dir opendir (my $rDH, $config->{stageDir} . "/$user/$repo") or die "Can't opendir ". $config->{stageDir} . "/$user/$repo : $!"; @@ -41,3 +42,9 @@ while (my $user = readdir($DH)) { } } +#final sync of all repos from the /var/git to /var/www/got/public/ for gotweb +my $rv=system(qq{ + openrsync --rsync-path=openrsync -a --delete $config->{gitDir}/* $config->{gotwebDir}/ +}); +warn "rsync failed from " . $config->{gitDir} . " to ". $config->{gotwebDir} . "\n$!\n" if ($rv != 0); +