Verified Commit 308a0861 authored by boklm's avatar boklm
Browse files

Bug 40018: rsync to tbb-nightlies-master after each build

parent 7775ed32
......@@ -2,6 +2,8 @@
use strict;
use FindBin;
use DateTime;
use IO::CaptureOutput qw(capture_exec);
use File::Slurp;
use TBBTestSuite::TestSuite::TorBrowserBuild;
my $date = DateTime->now->ymd;
......@@ -11,6 +13,20 @@ my $name = "tor-browser-$date";
my $builds_dir_root = '/home/tb-builder/nightly-builds';
my $reports_dir = "$builds_dir_root/reports";
my $run_rsync = sub {
# we fork to run the rsync in the background
# we do a double fork to prevent having zombie processes
my $pid = fork;
if ($pid) {
waitpid($pid, 0);
return;
}
exit 0 if fork;
capture_exec("$FindBin::Bin/tools/rsync-to-tbb-nightlies-master");
exit;
};
if (-d "$reports_dir/r/$name") {
print "Doing nothing: $name already done\n";
return ( args => [] );
......@@ -34,5 +50,6 @@ my %res = (
'email-report' => 1,
'email-to' => [ 'boklm@torproject.org', 'gk@torproject.org', 'sysrqb@torproject.org', ],
'email-from' => 'Tor Browser Nightly Builds <tb-builder@tb-build-01.torproject.org>',
'test_post' => $run_rsync,
);
%res;
#!/usr/bin/perl -w
use strict;
use FindBin;
use Path::Tiny;
my $lockfile = "$FindBin::Bin/rsync-to-tbb-nightlies-master.lock";
if (-f $lockfile) {
my $oldpid = path($lockfile)->slurp_utf8;
exit if kill 0, $oldpid;
unlink $lockfile;
}
path($lockfile)->spew_utf8($$);
system('rsync', '-aH', '--delete-before', '/home/tb-builder/nightly-builds/',
'tbb-nightlies@tbb-nightlies-master.torproject.org:/');
unlink $lockfile;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment