Changeset 27637 for other-projects/nightly-tasks/diffcol/trunk/task.pl
- Timestamp:
- 2013-06-17T22:05:58+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/task.pl
r27630 r27637 504 504 # ensure the upload directory exists before trying to transfer the xml and html files across 505 505 # if it already existed, clear it of contents 506 if ( -d $ENV{'UPLOAD_DIR'}) {506 if (!-d $ENV{'UPLOAD_DIR'}) { 507 507 &File::Path::make_path($ENV{'UPLOAD_DIR'}); 508 508 } # else rm $UPLOAD_DIR/* … … 515 515 } 516 516 closedir $dh; 517 518 519 # Upload the html file to puka 520 #default identity dir 521 if ( ! exists $ENV{'IDENTITY_DIR'} ) { 522 $ENV{'IDENTITY_DIR'} = "$ENV{'HOME'}${sep}.ssh"; 523 } 524 if (! exists $ENV{'SNAPSHOT_MODE'} ) { 525 $ENV{'SNAPSHOT_MODE'} = "caveat"; 526 } 527 528 #use the correct key for uploading 529 $ENV{'IDENTITY_FILE'} = "$ENV{'IDENTITY_DIR'}${sep}upload-" . $ENV{'SNAPSHOT_MODE'} . ($^O eq "MSWin32" ? ".ppk" : ""); 530 if(-f $ENV{'IDENTITY_FILE'}) { 531 my $command = "cd \"$ENV{'UPLOAD_DIR'}\" && tar -c *.html | "; #&& cat *.html | "; # && tar -c * | 532 $command .= ($^O eq "MSWin32" ? "plink" : "ssh"); 533 $command .= " -T -i \"$ENV{'IDENTITY_FILE'}\" nzdl\@puka.cs.waikato.ac.nz"; 534 #print "$command\n"; 535 my $status = system("$command"); 536 if($status != 0) { 537 print STDERR "*** Failed to upload test report to nzdl\n"; 538 } 539 } else { 540 print STDERR "*** Cannot upload the test report to nzdl from this machine\n"; 541 } 517 542 518 543 print STDERR "Finished uploading\n"; … … 560 585 561 586 # run the mail command 562 system($cmd); # &run_and_print_cmd($cmd); 563 564 print STDERR "Sent mail with report attached.\n"; 587 $result = system($cmd); #&run_and_print_cmd($cmd); 588 if($result != 0) { 589 print STDERR "*** Unable to send email: $?\n"; 590 } 591 else { 592 print STDERR "Sent mail with report attached.\n"; 593 } 565 594 } else { 566 595 print STDERR "********************************************\n";
Note:
See TracChangeset
for help on using the changeset viewer.