Update to 2023-08-17 16:00

This commit is contained in:
Daniel Berteaud
2023-08-17 16:00:21 +02:00
parent 846c668216
commit cc7c11ba8a
20 changed files with 611 additions and 35 deletions

View File

@@ -217,21 +217,26 @@ sub handle_submit {
if (defined $conf->{mirror} and defined $conf->{mirror}->{push}){
foreach my $mirror (@{$conf->{mirror}->{push}}){
log_info("[$job_id] syncing repo to $mirror->{dest}");
my $rsync_cmd = 'rsync ';
if (defined $mirror->{rsync_opts}){
$rsync_cmd .= join(' ', @{$mirror->{rsync_opts}});
my $sync_cmd;
if (defined $mirror->{sync_cmd}){
$sync_cmd = $mirror->{sync_cmd};
} else {
$rsync_cmd .= join(' ', @{$conf->{mirror}->{rsync_opts}});
$sync_cmd = 'rsync ';
if (defined $mirror->{rsync_opts}){
$sync_cmd .= join(' ', @{$mirror->{rsync_opts}});
} else {
$sync_cmd .= join(' ', @{$conf->{mirror}->{rsync_opts}});
}
$sync_cmd .= ' ' . $conf->{paths}->{repo} . '/ ' . $mirror->{dest} . '/';
}
$rsync_cmd .= ' ' . $conf->{paths}->{repo} . '/ ' . $mirror->{dest} . '/';
log_verbose("[$job_id] Running command $rsync_cmd");
foreach my $out (qx($rsync_cmd 2>&1)){
log_verbose("[$job_id] Running command $sync_cmd");
foreach my $out (qx($sync_cmd 2>&1)){
chomp $out;
log_verbose("[$job_id] $out");
}
if ($? != 0) {
log_info("[$job_id] Syncing to $mirror->{dest} failed");
handle_error($job_id, 'Mirror update error', "Command $rsync_cmd failed", $email);
handle_error($job_id, 'Mirror update error', "Command $sync_cmd failed", $email);
return;
}
}