mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 08:15:54 +02:00
Update to 2023-08-17 16:00
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user