All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH OSSTEST v7 1/2] cr-publish-flight-logs: support publishing files from $HOME/public_html
@ 2015-07-09 11:59 Ian Campbell
  2015-07-09 11:59 ` [PATCH OSSTEST v7 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
  2015-07-09 12:48 ` [PATCH OSSTEST v7 1/2] cr-publish-flight-logs: support publishing files from $HOME/public_html Ian Jackson
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Campbell @ 2015-07-09 11:59 UTC (permalink / raw)
  To: ian.jackson; +Cc: Ian Campbell, xen-devel

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@citrix.com>
---
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-09 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09 11:59 [PATCH OSSTEST v7 1/2] cr-publish-flight-logs: support publishing files from $HOME/public_html Ian Campbell
2015-07-09 11:59 ` [PATCH OSSTEST v7 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
2015-07-09 12:48 ` [PATCH OSSTEST v7 1/2] cr-publish-flight-logs: support publishing files from $HOME/public_html Ian Jackson
2015-07-09 13:54   ` Ian Campbell
2015-07-09 14:07     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.