get pushdir from build log r=preed b=378226

This commit is contained in:
rhelmer@mozilla.com 2007-04-24 14:25:05 -07:00
parent d95a02620d
commit d6e0724c78
3 changed files with 81 additions and 9 deletions

View File

@ -3,7 +3,6 @@
#
package Bootstrap::Step::Build;
use Bootstrap::Step;
use Bootstrap::Config;
@ISA = ("Bootstrap::Step");
sub Execute {
@ -18,9 +17,11 @@ sub Execute {
my $rcTag = $productTag . '_RC' . $rc;
my $lastBuilt = catfile($buildDir, $buildPlatform, 'last-built');
unlink($lastBuilt)
or $this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
$this->Log(msg => "Unlinked $lastBuilt");
if (! unlink($lastBuilt)) {
$this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
} else {
$this->Log(msg => "Unlinked $lastBuilt");
}
my $buildLog = catfile($logDir, 'build_' . $rcTag . '-build.log');
@ -33,6 +34,7 @@ sub Execute {
logFile => $buildLog,
timeout => 36000
);
}
sub Verify {
@ -51,6 +53,17 @@ sub Verify {
log => $buildLog,
notAllowed => 'tinderbox: status: failed',
);
my $logParser = new MozBuild::TinderLogParse(
logFile => $buildLog,
);
if (! defined($logParser->GetBuildID())) {
die("No buildID found in $buildLog");
}
if (! defined($logParser->GetPushDir())) {
die("No pushDir found in $buildLog");
}
}
sub Announce {
@ -66,9 +79,22 @@ sub Announce {
my $rcTag = $productTag . '_RC' . $rc;
my $buildLog = catfile($logDir, 'build_' . $rcTag . '-build.log');
my $logParser = new MozBuild::TinderLogParse(
logFile => $buildLog,
);
my $buildID = $logParser->GetBuildID();
my $pushDir = $logParser->GetPushDir();
if (! defined($buildID)) {
die("No buildID found in $buildLog");
}
if (! defined($pushDir)) {
die("No pushDir found in $buildLog");
}
$this->SendAnnouncement(
subject => "$product $version build step finished",
message => "$product $version en-US build is ready to be copied to the candidates dir.",
message => "$product $version en-US build is ready to be copied to the candidates dir.\nBuild ID is $buildID\nPush Dir is $pushDir",
);
}

View File

@ -159,23 +159,32 @@ sub Verify {
logFile => catfile($logDir, 'repack_metadiff-l10n_verification.log'),
);
}
sub Announce {
my $this = shift;
my $config = new Bootstrap::Config();
my $product = $config->Get(var => 'product');
my $version = $config->Get(var => 'version');
my $productTag = $config->Get(var => 'productTag');
my $version = $config->Get(var => 'version');
my $rc = $config->Get(var => 'rc');
my $logDir = $config->Get(var => 'logDir');
my $rcTag = $productTag . '_RC' . $rc;
my $buildLog = catfile($logDir, 'repack_' . $rcTag . '-build-l10n.log');
my $logParser = new MozBuild::TinderLogParse(
logFile => $buildLog,
);
my $buildID = $logParser->GetBuildID();
my $pushDir = $logParser->GetPushDir();
if (! defined($pushDir)) {
die("No pushDir found in $buildLog");
}
$this->SendAnnouncement(
subject => "$product $version l10n repack step finished",
message => "$product $version l10n builds are ready to be copied to the candidates directory.",
message => "$product $version l10n builds are ready to be copied to the candidates directory.\nPush Dir is $pushDir",
);
}

View File

@ -55,9 +55,46 @@ sub GetBuildID {
return $buildID;
}
##
# GetPushDir - attempts to find the directory Tinderbox pushed to build to
#
# Searches for a string of the form:
# Linux Firefox Build available at:
# localhost/2007-04-07-18-firefox2.0.0.4/
# Matches on "Build available at:" and returns the next line.
##
sub GetPushDir {
my $this = shift;
my %args = @_;
my $log = $this->GetLogFileName();
my $found = 0;
my $pushDir = undef;
my $searchString = "Build available at:";
open (FILE, "< $log") or die("Cannot open file $log: $!");
while (<FILE>) {
if ($found) {
$pushDir = $_;
last;
}
if ($_ =~ /$searchString/) {
$found = 1;
}
}
close FILE or die("Cannot close file $log: $!");
return $pushDir;
}
sub GetLogFileName {
my $this = shift;
my %args = @_;
return $this->{'fileName'};
return $this->{'logFile'};
}
1;