[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v7 1/2] cr-publish-flight-logs: support publishing files from $HOME/public_html



Any arguments given after the flight are assumed to be files or
directories relative to $HOME/public_html which should be published to
$c{Publish} at the same relative path.

Removing the requirement that a flight be provided, by accepting '',
allows this to be used even in contexts which have no flight.

The results subtree is always published if $c{ResultsPublish} is set,
since it doesn't depend on any particular flight.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v7: New patch
---
 cr-publish-flight-logs | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs
index 94c74c8..0fdd02d 100755
--- a/cr-publish-flight-logs
+++ b/cr-publish-flight-logs
@@ -31,10 +31,10 @@ if (@ARGV && $ARGV[0] eq '--push-harness') {
     $push_harness = 1;
 }
 
-die "usage: ./cr-publish-flight-logs <flight>" unless @ARGV==1;
+die "usage: ./cr-publish-flight-logs <flight|''> [public_html files]" unless 
@ARGV>=1;
 
 my $flight= shift @ARGV;
-die unless $flight =~ m/^\d+$/;
+die unless $flight =~ m/^\d*$/;
 
 open LOCK, "> $c{GlobalLockDir}/publish-lock" or die $!;
 flock LOCK, LOCK_EX or die $!;
@@ -49,7 +49,7 @@ if ($push_harness) {
     system_checked("ssh $githost 'cd $gitdir && git update-server-info'");
 }
 
-sub copydir ($$) {
+sub copylogs ($$) {
     my ($src,$dst) = @_;
     my @cmd= qw(rsync --compress --compress-level=9 --stats --delete -auH);
     push @cmd, '-e', 'ssh -o batchmode=yes';
@@ -59,5 +59,11 @@ sub copydir ($$) {
     $!=0; $?=0; system @cmd; die "rsync $? $!" if $? or $!;
 }
 
-copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight") if $c{LogsPublish};
-copydir("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish};
+copylogs("$c{Logs}/$flight/", "$c{LogsPublish}/$flight")
+    if $flight && $c{LogsPublish};
+copylogs("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish};
+
+if ( $c{Publish} ) {
+    copylogs("$ENV{'HOME'}/public_html/$_", "$c{Publish}/$_")
+       foreach @ARGV;
+}
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.