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>
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 // '';
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 ($$) {
: ${OSSTEST_CRON_SETTINGS:=$dcs-real}
: ${OSSTEST_HTML_SUFFIX:=-play}
shift
+else
+ : ${OSSTEST_PUSH_HARNESS=--push-harness-try}
fi
: ${OSSTEST_BLESSING:=play}
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
}