]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
cr-daily-branch, cr-publish-flight-logs: Tolerate failure to push harness
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 13 Jun 2018 13:50:13 +0000 (14:50 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Jun 2018 14:00:14 +0000 (15:00 +0100)
Provide cr-publish-flight-logs --push-harness-try, which attempts the
push but doesn't mind if it fails.

If we are not --real, tolerate failure to publish the flight logs.

Also, honour OSSTEST_PUSH_HARNESS which might contain '' or
--push-harness or --push-harness-try.

CC: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
cr-publish-flight-logs
cri-args-hostlists

index 45545ce2140247443487fd522587b347bc0159cc..1e5a49df764aa5824193513eca6edc6363af55f4 100755 (executable)
@@ -27,9 +27,9 @@ our %c;
 readglobalconfig();
 
 my $push_harness = 0;
-if (@ARGV && $ARGV[0] eq '--push-harness') {
+if (@ARGV && $ARGV[0] =~ m{^--push-harness(?:-try)?$}) {
+    $push_harness = $&;
     shift @ARGV;
-    $push_harness = 1;
 }
 
 my $flight= shift @ARGV // '';
@@ -46,8 +46,14 @@ if ($push_harness) {
 
     exit 0 if (!$githost || !$gitdir);
 
+    eval {
     system_checked("git push $githost:$gitdir HEAD:refs/heads/flight-$flight");
     system_checked("ssh $githost 'cd $gitdir && git update-server-info'");
+    };
+    if ($@) {
+       $push_harness eq '--push-harness-try' or die;
+       warn;
+    }
 }
 
 sub copydir ($$) {
index a75ff7bfb930766f6016f2a5ad0a7106e282ad21..7d230875df986bf87f541fb4c834fd0a36011df6 100644 (file)
@@ -51,6 +51,8 @@ elif [ "x$1" = "x--like-real" ]; then
        : ${OSSTEST_CRON_SETTINGS:=$dcs-real}
        : ${OSSTEST_HTML_SUFFIX:=-play}
        shift
+else
+       : ${OSSTEST_PUSH_HARNESS=--push-harness-try}
 fi     
 : ${OSSTEST_BLESSING:=play}
 
@@ -127,7 +129,8 @@ start_email () {
 publish_send_email () {
        local flight=$1
        exec >&2
-       ./cr-publish-flight-logs --push-harness $flight
+       ./cr-publish-flight-logs ${OSSTEST_PUSH_HARNESS- --push-harness} \
+           $flight
        send_email tmp/$flight.email
 }