зеркало из https://github.com/mozilla/pjs.git
cleanup and consistency r=preed b=369004
This commit is contained in:
Родитель
50fd6d8563
Коммит
159eb16cd2
|
@ -30,7 +30,7 @@ sub Parse {
|
|||
my $this = shift;
|
||||
|
||||
open (CONFIG, "< bootstrap.cfg")
|
||||
|| die "Can't open config file bootstrap.cfg";
|
||||
|| die("Can't open config file bootstrap.cfg");
|
||||
|
||||
while (<CONFIG>) {
|
||||
chomp; # no newline
|
||||
|
|
|
@ -32,32 +32,32 @@ sub Shell {
|
|||
my $rv = '';
|
||||
|
||||
if (ref($cmdArgs) ne 'ARRAY') {
|
||||
die "ASSERT: Bootstrap::Step(): cmdArgs is not an array ref\n"
|
||||
die("ASSERT: Bootstrap::Step(): cmdArgs is not an array ref\n");
|
||||
}
|
||||
|
||||
if ($dir) {
|
||||
$this->Log('msg' => 'Changing directory to ' . $dir);
|
||||
chdir($dir) or die "Cannot chdir to $dir: $!";
|
||||
$this->Log(msg => 'Changing directory to ' . $dir);
|
||||
chdir($dir) or die("Cannot chdir to $dir: $!");
|
||||
}
|
||||
|
||||
$this->Log('msg' => 'Running shell command:');
|
||||
$this->Log('msg' => ' arg0: ' . $cmd);
|
||||
$this->Log(msg => 'Running shell command:');
|
||||
$this->Log(msg => ' arg0: ' . $cmd);
|
||||
my $argNum = 1;
|
||||
foreach my $arg (@{$cmdArgs}) {
|
||||
$this->Log('msg' => ' arg' . $argNum . ': ' . $arg);
|
||||
$this->Log(msg => ' arg' . $argNum . ': ' . $arg);
|
||||
$argNum += 1;
|
||||
}
|
||||
$this->Log('msg' => 'Starting time is ' . $this->CurrentTime());
|
||||
$this->Log('msg' => 'Logging output to ' . $logFile);
|
||||
$this->Log(msg => 'Starting time is ' . $this->CurrentTime());
|
||||
$this->Log(msg => 'Logging output to ' . $logFile);
|
||||
|
||||
$this->Log('msg' => 'Timeout: ' . $timeout);
|
||||
$this->Log(msg => 'Timeout: ' . $timeout);
|
||||
|
||||
if ($timeout) {
|
||||
$rv = RunShellCommand(
|
||||
'command' => $cmd,
|
||||
'args' => $cmdArgs,
|
||||
'timeout' => $timeout,
|
||||
'logfile' => $logFile,
|
||||
command => $cmd,
|
||||
args => $cmdArgs,
|
||||
timeout => $timeout,
|
||||
logfile => $logFile,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -66,29 +66,29 @@ sub Shell {
|
|||
my $signalName = $rv->{'signalName'};
|
||||
my $dumpedCore = $rv->{'dumpedCore'};
|
||||
if ($timedOut) {
|
||||
$this->Log('msg' => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die("FAIL shell call timed out after $timeout seconds");
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die('FAIL shell call timed out after' . $timeout . 'seconds');
|
||||
}
|
||||
if ($signalName) {
|
||||
$this->Log('msg' => 'WARNING shell recieved signal' . $signalName);
|
||||
$this->Log(msg => 'WARNING shell recieved signal' . $signalName);
|
||||
}
|
||||
if ($dumpedCore) {
|
||||
$this->Log('msg' => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die("FAIL shell call dumped core");
|
||||
}
|
||||
if ($exitValue) {
|
||||
if ($exitValue != 0) {
|
||||
$this->Log('msg' => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
$this->Log(msg => "output: $rv->{'output'}") if $rv->{'output'};
|
||||
die("shell call returned bad exit code: $exitValue");
|
||||
}
|
||||
}
|
||||
|
||||
if ($rv->{'output'} && not defined($logFile)) {
|
||||
$this->Log('msg' => "output: $rv->{'output'}");
|
||||
$this->Log(msg => "output: $rv->{'output'}");
|
||||
}
|
||||
|
||||
# current time
|
||||
$this->Log('msg' => 'Ending time is ' . $this->CurrentTime());
|
||||
$this->Log(msg => 'Ending time is ' . $this->CurrentTime());
|
||||
}
|
||||
|
||||
sub Log {
|
||||
|
@ -108,31 +108,31 @@ sub CheckLog {
|
|||
my $checkForOnly = $args{'checkForOnly'};
|
||||
|
||||
if (not defined($log)) {
|
||||
die "No log file specified";
|
||||
die("No log file specified");
|
||||
}
|
||||
|
||||
open (FILE, "< $log") or die "Cannot open file $log: $!";
|
||||
open (FILE, "< $log") or die("Cannot open file $log: $!");
|
||||
my @contents = <FILE>;
|
||||
close FILE or die "Cannot close file $log: $!";
|
||||
close FILE or die("Cannot close file $log: $!");
|
||||
|
||||
if ($notAllowed) {
|
||||
my @errors = grep(/$notAllowed/i, @contents);
|
||||
if (@errors) {
|
||||
die "Errors in log ($log): \n\n @errors \n";
|
||||
die("Errors in log ($log): \n\n @errors");
|
||||
}
|
||||
}
|
||||
if ($checkFor) {
|
||||
if (not grep(/$checkFor/i, @contents)) {
|
||||
die "$checkFor is not present in file $log \n";
|
||||
die("$checkFor is not present in file $log");
|
||||
}
|
||||
}
|
||||
if ($checkForOnly) {
|
||||
if (not grep(/$checkForOnly/i, @contents)) {
|
||||
die "$checkForOnly is not present in file $log \n";
|
||||
die("$checkForOnly is not present in file $log");
|
||||
}
|
||||
my @errors = grep(!/$checkForOnly/i, @contents);
|
||||
if (@errors) {
|
||||
die "Errors in log ($log): \n\n @errors \n";
|
||||
die("Errors in log ($log): \n\n @errors");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,9 +159,12 @@ sub SendAnnouncement() {
|
|||
|
||||
my $config = new Bootstrap::Config();
|
||||
|
||||
my $blat = $config->Get(var => 'blat');
|
||||
my $sendmail = $config->Get(var => 'sendmail');
|
||||
my $from = $args{'from'} ? $args{'from'} : $config->Get(var => 'from');
|
||||
my $to = $args{'to'} ? $args{'to'} : $config->Get(var => 'to');
|
||||
my $cc = $args{'cc'} ? $args{'cc'} : $config->Get(var => 'cc');
|
||||
|
||||
my $subject = $args{'subject'};
|
||||
my $message = $args{'message'};
|
||||
|
||||
|
@ -169,6 +172,8 @@ sub SendAnnouncement() {
|
|||
|
||||
eval {
|
||||
Email(
|
||||
blat => $blat,
|
||||
sendmail => $sendmail,
|
||||
from => $from,
|
||||
to => $to,
|
||||
cc => \@ccList,
|
||||
|
|
|
@ -6,66 +6,62 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $buildDir = $config->Get('var' => 'buildDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $buildPlatform = $config->Get('var' => 'buildPlatform');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $buildDir = $config->Get(var => 'buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $buildPlatform = $config->Get(var => 'buildPlatform');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
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");
|
||||
or $this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
|
||||
$this->Log(msg => "Unlinked $lastBuilt");
|
||||
|
||||
my $buildLog = catfile($logDir, 'build_' . $rcTag . '-build.log');
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => './build-seamonkey.pl',
|
||||
'cmdArgs' => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($buildDir, 'tinderbox-configs')],
|
||||
'dir' => $buildDir,
|
||||
'logFile' => $buildLog,
|
||||
'timeout' => 36000
|
||||
cmd => './build-seamonkey.pl',
|
||||
cmdArgs => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($buildDir, 'tinderbox-configs')],
|
||||
dir => $buildDir,
|
||||
logFile => $buildLog,
|
||||
timeout => 36000
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $buildDir = $config->Get('var' => 'buildDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $buildDir = $config->Get(var => 'buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
my $buildLog = catfile($logDir, 'build_' . $rcTag . '-build.log');
|
||||
|
||||
$this->CheckLog(
|
||||
'log' => $buildLog,
|
||||
'notAllowed' => 'tinderbox: status: failed',
|
||||
log => $buildLog,
|
||||
notAllowed => 'tinderbox: status: failed',
|
||||
);
|
||||
|
||||
# $this->CheckLog(
|
||||
# 'log' => $buildLog,
|
||||
# 'notAllowed' => '^Error:',
|
||||
# );
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
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 $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
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, 'build_' . $rcTag . '-build.log');
|
||||
|
|
|
@ -8,81 +8,75 @@ use Bootstrap::Config;
|
|||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $buildDir = $config->Get('var' => 'l10n_buildDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $buildPlatform = $config->Get('var' => 'buildPlatform');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $buildDir = $config->Get(var => 'l10n_buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $buildPlatform = $config->Get(var => 'buildPlatform');
|
||||
my $rcTag = $productTag . '_RC' . $rc;
|
||||
|
||||
my $buildLog = catfile($logDir, 'repack_' . $rcTag . '-build-l10n.log');
|
||||
my $lastBuilt = catfile($buildDir, $buildPlatform, 'last-built');
|
||||
unlink($lastBuilt)
|
||||
or $this->Log('msg' => "Cannot unlink last-built file $lastBuilt: $!");
|
||||
$this->Log('msg' => "Unlinked $lastBuilt");
|
||||
or $this->Log(msg => "Cannot unlink last-built file $lastBuilt: $!");
|
||||
$this->Log(msg => "Unlinked $lastBuilt");
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => './build-seamonkey.pl',
|
||||
'cmdArgs' => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($buildDir, 'tinderbox-configs')],
|
||||
'dir' => $buildDir,
|
||||
'logFile' => $buildLog,
|
||||
'timeout' => 36000
|
||||
cmd => './build-seamonkey.pl',
|
||||
cmdArgs => ['--once', '--mozconfig', 'mozconfig', '--depend',
|
||||
'--config-cvsup-dir',
|
||||
catfile($buildDir, 'tinderbox-configs')],
|
||||
dir => $buildDir,
|
||||
logFile => $buildLog,
|
||||
timeout => 36000
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $buildDir = $config->Get('var' => 'buildDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $oldRc = $config->Get('var' => 'oldRc');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $oldVersion = $config->Get('var' => 'oldVersion');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $verifyDir = $config->Get('var' => 'verifyDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $buildDir = $config->Get(var => 'buildDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $oldRc = $config->Get(var => 'oldRc');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $oldVersion = $config->Get(var => 'oldVersion');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $verifyDir = $config->Get(var => 'verifyDir');
|
||||
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
||||
# XXX temp disabled
|
||||
# $this->CheckLog(
|
||||
# 'log' => $buildLog,
|
||||
# 'notAllowed' => 'failed',
|
||||
# );
|
||||
|
||||
# l10n metadiff test
|
||||
|
||||
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
|
||||
|
||||
MkdirWithPath('dir' => $verifyDirVersion)
|
||||
or die "Cannot mkdir $verifyDirVersion: $!";
|
||||
MkdirWithPath(dir => $verifyDirVersion)
|
||||
or die("Cannot mkdir $verifyDirVersion: $!");
|
||||
|
||||
# check out l10n verification scripts
|
||||
foreach my $dir ('common', 'l10n') {
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mozillaCvsroot,
|
||||
'co', '-d', $dir,
|
||||
catfile('mozilla', 'testing', 'release', $dir)],
|
||||
'dir' => $verifyDirVersion,
|
||||
'logFile' => catfile($logDir,
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot,
|
||||
'co', '-d', $dir,
|
||||
catfile('mozilla', 'testing', 'release', $dir)],
|
||||
dir => $verifyDirVersion,
|
||||
logFile => catfile($logDir,
|
||||
'repack_checkout-l10n_verification.log'),
|
||||
);
|
||||
}
|
||||
|
||||
# Download current release
|
||||
$this->Shell(
|
||||
'cmd' => 'echo',
|
||||
'cmdArgs' => ['-av',
|
||||
cmd => 'echo',
|
||||
cmdArgs => ['-av',
|
||||
'-e', 'ssh',
|
||||
'--include="*.dmg"',
|
||||
'--include="*.exe"',
|
||||
|
@ -92,16 +86,16 @@ sub Verify {
|
|||
. '/nightly/' . $version . '-candidates/rc' . $rc . '/',
|
||||
$product . '-' . $version . '-rc' . $rc . '/',
|
||||
],
|
||||
'dir' => $buildDir,
|
||||
'logFile' =>
|
||||
dir => $buildDir,
|
||||
logFile =>
|
||||
catfile($logDir, 'repack_verify-download_' . $version . '.log'),
|
||||
'timeout' => 3600
|
||||
timeout => 3600
|
||||
);
|
||||
|
||||
# Download previous release
|
||||
$this->Shell(
|
||||
'cmd' => 'echo',
|
||||
'cmdArgs' => ['-av',
|
||||
cmd => 'echo',
|
||||
cmdArgs => ['-av',
|
||||
'-e', 'ssh',
|
||||
'--include="*.dmg"',
|
||||
'--include="*.exe"',
|
||||
|
@ -112,58 +106,59 @@ sub Verify {
|
|||
. $oldRc . '/',
|
||||
$product . '-' . $oldVersion . '-rc' . $oldRc . '/',
|
||||
],
|
||||
'dir' => $buildDir,
|
||||
'logFile' =>
|
||||
dir => $buildDir,
|
||||
logFile =>
|
||||
catfile($logDir, 'repack_verify-download_' . $oldVersion . '.log'),
|
||||
'timeout' => 3600
|
||||
timeout => 3600
|
||||
);
|
||||
|
||||
my $newProduct = $product . '-' . $version . '-' . 'rc' . $rc;
|
||||
my $oldProduct = $product . '-' . $oldVersion . '-' . 'rc' . $rc;
|
||||
|
||||
foreach my $product ($newProduct, $oldProduct) {
|
||||
MkdirWithPath('dir' => catfile($verifyDirVersion, 'l10n', $product))
|
||||
or die "Cannot mkdir $verifyDirVersion/$product: $!";
|
||||
MkdirWithPath(dir => catfile($verifyDirVersion, 'l10n', $product))
|
||||
or die("Cannot mkdir $verifyDirVersion/$product: $!");
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => './verify_l10n.sh',
|
||||
'cmdArgs' => [$product],
|
||||
'dir' => catfile($verifyDirVersion, 'l10n'),
|
||||
'logFile' => catfile($logDir,
|
||||
'repack_' . $product . '-l10n_verification.log'),
|
||||
cmd => './verify_l10n.sh',
|
||||
cmdArgs => [$product],
|
||||
dir => catfile($verifyDirVersion, 'l10n'),
|
||||
logFile => catfile($logDir,
|
||||
'repack_' . $product . '-l10n_verification.log'),
|
||||
);
|
||||
|
||||
|
||||
foreach my $rule ('^Only', '^Binary') {
|
||||
$this->CheckLog(
|
||||
'log' => $logDir .
|
||||
'/repack_' . $product . '-l10n_verification.log',
|
||||
'notAllowed' => $rule,
|
||||
log => $logDir .
|
||||
'/repack_' . $product . '-l10n_verification.log',
|
||||
notAllowed => $rule,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# generate metadiff
|
||||
$this->Shell(
|
||||
'cmd' => 'diff',
|
||||
'cmdArgs' => ['-r',
|
||||
cmd => 'diff',
|
||||
cmdArgs => ['-r',
|
||||
catfile($logDir,
|
||||
'repack_' . $newProduct . '-l10n_verification.log'),
|
||||
catfile($logDir,
|
||||
'repack_' . $oldProduct . '-l10n_verification.log')],
|
||||
'dir' => catfile($verifyDirVersion, 'l10n'),
|
||||
'logFile' => catfile($logDir, 'repack_metadiff-l10n_verification.log'),
|
||||
dir => catfile($verifyDirVersion, 'l10n'),
|
||||
logFile => catfile($logDir, 'repack_metadiff-l10n_verification.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
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');
|
||||
|
|
|
@ -6,27 +6,29 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'echo',
|
||||
'cmdArgs' => ['sign'],
|
||||
'logFile' => catfile($logDir, 'sign.log'),
|
||||
cmd => 'echo',
|
||||
cmdArgs => ['sign'],
|
||||
logFile => catfile($logDir, 'sign.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'echo',
|
||||
'cmdArgs' => ['Verify sign'],
|
||||
'logFile' => catfile($logDir, 'sign_verify.log'),
|
||||
cmd => 'echo',
|
||||
cmdArgs => ['Verify sign'],
|
||||
logFile => catfile($logDir, 'sign_verify.log'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,33 +9,32 @@ use File::Copy qw(move);
|
|||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
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 $stageHome = $config->Get('var' => 'stageHome');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
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 $stageHome = $config->Get(var => 'stageHome');
|
||||
|
||||
# create staging area
|
||||
my $stageDir = catfile($stageHome, $product . '-' . $version,
|
||||
'batch-source', 'rc' . $rc);
|
||||
|
||||
if (not -d $stageDir) {
|
||||
MkdirWithPath('dir' => $stageDir)
|
||||
or die "Cannot create $stageDir: $!";
|
||||
MkdirWithPath(dir => $stageDir)
|
||||
or die("Cannot create $stageDir: $!");
|
||||
}
|
||||
|
||||
my $srcScript = $product . '-src-tarball-nobuild';
|
||||
$this->Shell(
|
||||
'cmd' => catfile($stageHome, 'bin', $srcScript),
|
||||
'cmdArgs' => ['-r', $productTag . '_RELEASE', '-m', $version],
|
||||
'dir' => $stageDir,
|
||||
'logFile' => catfile($logDir, 'source.log'),
|
||||
cmd => catfile($stageHome, 'bin', $srcScript),
|
||||
cmdArgs => ['-r', $productTag . '_RELEASE', '-m', $version],
|
||||
dir => $stageDir,
|
||||
logFile => catfile($logDir, 'source.log'),
|
||||
);
|
||||
|
||||
move("$stageDir/../*.bz2", $stageDir);
|
||||
|
@ -50,9 +49,10 @@ sub Verify {
|
|||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
my $logFile = catfile($logDir, 'source.log');
|
||||
|
||||
|
|
|
@ -12,16 +12,15 @@ use MozBuild::Util qw(MkdirWithPath);
|
|||
|
||||
use strict;
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $stageHome = $config->Get('var' => 'stageHome');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
|
||||
## Prepare the staging directory for the release.
|
||||
# Create the staging directory.
|
||||
|
@ -30,17 +29,17 @@ sub Execute {
|
|||
my $mergeDir = catfile($stageDir, 'stage-merged');
|
||||
|
||||
if (not -d $stageDir) {
|
||||
MkdirWithPath('dir' => $stageDir)
|
||||
or die "Could not mkdir $stageDir: $!";
|
||||
$this->Log('msg' => "Created directory $stageDir");
|
||||
MkdirWithPath(dir => $stageDir)
|
||||
or die("Could not mkdir $stageDir: $!");
|
||||
$this->Log(msg => "Created directory $stageDir");
|
||||
}
|
||||
|
||||
# Create skeleton batch directory.
|
||||
my $skelDir = catfile($stageDir, 'batch-skel', 'stage');
|
||||
if (not -d "$skelDir") {
|
||||
MkdirWithPath('dir' => $skelDir)
|
||||
MkdirWithPath(dir => $skelDir)
|
||||
or die "Cannot create $skelDir: $!";
|
||||
$this->Log('msg' => "Created directory $skelDir");
|
||||
$this->Log(msg => "Created directory $skelDir");
|
||||
}
|
||||
|
||||
my (undef, undef, $gid) = getgrnam($product)
|
||||
|
@ -51,17 +50,17 @@ sub Execute {
|
|||
for my $dir ('contrib', 'contrib-localized') {
|
||||
my $fullDir = catfile($skelDir, $dir);
|
||||
if (not -d $fullDir) {
|
||||
MkdirWithPath('dir' => $fullDir)
|
||||
MkdirWithPath(dir => $fullDir)
|
||||
or die "Could not mkdir $fullDir : $!";
|
||||
$this->Log('msg' => "Created directory $fullDir");
|
||||
$this->Log(msg => "Created directory $fullDir");
|
||||
}
|
||||
|
||||
chmod(oct(2775), $fullDir)
|
||||
or die "Cannot change mode on $fullDir to 2775: $!";
|
||||
$this->Log('msg' => "Changed mode of $fullDir to 2775");
|
||||
$this->Log(msg => "Changed mode of $fullDir to 2775");
|
||||
chown(-1, $gid, $fullDir)
|
||||
or die "Cannot chgrp $fullDir to $product: $!";
|
||||
$this->Log('msg' => "Changed group of $fullDir to $product");
|
||||
$this->Log(msg => "Changed group of $fullDir to $product");
|
||||
}
|
||||
|
||||
# NOTE - should have a standard "master" copy somewhere else
|
||||
|
@ -72,36 +71,36 @@ sub Execute {
|
|||
|
||||
## Prepare the merging directory.
|
||||
$this->Shell(
|
||||
'cmd' => 'rsync',
|
||||
'cmdArgs' => ['-av', 'batch-skel/stage/', 'stage-merged/'],
|
||||
'logFile' => catfile($logDir, 'stage_merge_skel.log'),
|
||||
'dir' => $stageDir,
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', 'batch-skel/stage/', 'stage-merged/'],
|
||||
logFile => catfile($logDir, 'stage_merge_skel.log'),
|
||||
dir => $stageDir,
|
||||
);
|
||||
|
||||
# Collect the release files onto stage.mozilla.org.
|
||||
|
||||
my $prestageDir = catfile($stageDir, 'batch1', 'prestage');
|
||||
if (not -d $prestageDir) {
|
||||
MkdirWithPath('dir' => $prestageDir)
|
||||
MkdirWithPath(dir => $prestageDir)
|
||||
or die "Cannot create $prestageDir: $!";
|
||||
$this->Log('msg' => "Created directory $prestageDir");
|
||||
$this->Log(msg => "Created directory $prestageDir");
|
||||
}
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'rsync',
|
||||
'cmdArgs' => ['-Lav', catfile('/home', 'ftp', 'pub', $product, 'nightly',
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav', catfile('/home', 'ftp', 'pub', $product, 'nightly',
|
||||
$version . '-candidates', 'rc' . $rc . '/'),
|
||||
'./'],
|
||||
'logFile' => catfile($logDir, 'stage_collect.log'),
|
||||
'dir' => catfile($stageDir, 'batch1', 'prestage'),
|
||||
logFile => catfile($logDir, 'stage_collect.log'),
|
||||
dir => catfile($stageDir, 'batch1', 'prestage'),
|
||||
);
|
||||
|
||||
# Remove unreleased builds
|
||||
$this->Shell(
|
||||
'cmd' => 'rsync',
|
||||
'cmdArgs' => ['-av', 'prestage/', 'prestage-trimmed/'],
|
||||
'logFile' => catfile($logDir, 'stage_collect_trimmed.log'),
|
||||
'dir' => catfile($stageDir, 'batch1'),
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-av', 'prestage/', 'prestage-trimmed/'],
|
||||
logFile => catfile($logDir, 'stage_collect_trimmed.log'),
|
||||
dir => catfile($stageDir, 'batch1'),
|
||||
);
|
||||
|
||||
# Remove unshipped files and set proper mode on dirs
|
||||
|
@ -109,39 +108,40 @@ sub Execute {
|
|||
$stageDir . catfile('batch1', 'prestage-trimmed'));
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'rsync',
|
||||
'cmdArgs' => ['-Lav', 'prestage-trimmed/', 'stage/'],
|
||||
'logFile' => catfile($logDir, 'stage_collect_stage.log'),
|
||||
'dir' => catfile($stageDir, 'batch1'),
|
||||
cmd => 'rsync',
|
||||
cmdArgs => ['-Lav', 'prestage-trimmed/', 'stage/'],
|
||||
logFile => catfile($logDir, 'stage_collect_stage.log'),
|
||||
dir => catfile($stageDir, 'batch1'),
|
||||
);
|
||||
|
||||
# Nightly builds using a different naming scheme than production.
|
||||
# Rename the files.
|
||||
# TODO should support --long filenames, for e.g. Alpha and Beta
|
||||
$this->Shell(
|
||||
'cmd' => catfile($stageHome, 'bin', 'groom-files'),
|
||||
'cmdArgs' => ['--short=' . $version, '.'],
|
||||
'logFile' => catfile($logDir, 'stage_groom_files.log'),
|
||||
'dir' => catfile($stageDir, 'batch1', 'stage'),
|
||||
cmd => catfile($stageHome, 'bin', 'groom-files'),
|
||||
cmdArgs => ['--short=' . $version, '.'],
|
||||
logFile => catfile($logDir, 'stage_groom_files.log'),
|
||||
dir => catfile($stageDir, 'batch1', 'stage'),
|
||||
);
|
||||
|
||||
# fix xpi dir names
|
||||
my $fromFile = catfile($stageDir, 'batch1', 'stage', 'windows');
|
||||
my $toFile = catfile($stageDir, 'batch1', 'stage', 'win32');
|
||||
move($fromFile, $toFile)
|
||||
or die('msg' => "Cannot rename $fromFile $toFile: $!");
|
||||
$this->Log('msg' => "Moved $fromFile $toFile");
|
||||
or die(msg => "Cannot rename $fromFile $toFile: $!");
|
||||
$this->Log(msg => "Moved $fromFile $toFile");
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $appName = $config->Get('var' => 'appName');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $stageHome = $config->Get('var' => 'stageHome');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $stageHome = $config->Get(var => 'stageHome');
|
||||
|
||||
## Prepare the staging directory for the release.
|
||||
# Create the staging directory.
|
||||
|
@ -150,16 +150,18 @@ sub Verify {
|
|||
|
||||
# Verify locales
|
||||
$this->Shell(
|
||||
'cmd' => catfile($stageHome, 'bin', 'verify-locales.pl'),
|
||||
'cmdArgs' => ['-m', catfile($stageDir, 'batch-source', 'rc' . $rc,
|
||||
'mozilla', $appName, 'locales', 'shipped-locales')],
|
||||
'logFile' => catfile($logDir, 'stage_verify_l10n.log'),
|
||||
'dir' => catfile($stageDir, 'batch1', 'stage'),
|
||||
cmd => catfile($stageHome, 'bin', 'verify-locales.pl'),
|
||||
cmdArgs => ['-m', catfile($stageDir, 'batch-source', 'rc' . $rc,
|
||||
'mozilla', $appName, 'locales', 'shipped-locales')],
|
||||
logFile => catfile($logDir, 'stage_verify_l10n.log'),
|
||||
dir => catfile($stageDir, 'batch1', 'stage'),
|
||||
);
|
||||
}
|
||||
|
||||
sub TrimCallback {
|
||||
my $this = shift;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $dirent = $File::Find::name;
|
||||
|
||||
if (-f $dirent) {
|
||||
|
@ -178,22 +180,22 @@ sub TrimCallback {
|
|||
($dirent =~ /\.zip$/) ||
|
||||
($dirent =~ /en-US\.xpi$/)) {
|
||||
unlink($dirent) || die "Could not unlink $dirent: $!";
|
||||
$this->Log('msg' => "Unlinked $dirent");
|
||||
$this->Log(msg => "Unlinked $dirent");
|
||||
} else {
|
||||
chmod(0644, $dirent)
|
||||
|| die "Could not chmod $dirent to 0644: $!";
|
||||
$this->Log('msg' => "Changed mode of $dirent to 0644");
|
||||
$this->Log(msg => "Changed mode of $dirent to 0644");
|
||||
}
|
||||
} elsif (-d $dirent) {
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $product = $config->Get(var => 'product');
|
||||
my (undef, undef, $gid) = getgrnam($product)
|
||||
or die "Could not getgrname for $product: $!";
|
||||
chown(-1, $gid, $dirent)
|
||||
or die "Cannot chgrp $dirent to $product: $!";
|
||||
$this->Log('msg' => "Changed group of $dirent to $product");
|
||||
$this->Log(msg => "Changed group of $dirent to $product");
|
||||
chmod(0755, $dirent)
|
||||
or die "Could not chmod $dirent to 0755: $!";
|
||||
$this->Log('msg' => "Changed mode of $dirent to 0755");
|
||||
$this->Log(msg => "Changed mode of $dirent to 0755");
|
||||
} else {
|
||||
die("Unexpected non-file/non-dir directory entry: $dirent");
|
||||
}
|
||||
|
@ -202,8 +204,9 @@ sub TrimCallback {
|
|||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version stage step finished",
|
||||
|
|
|
@ -12,20 +12,19 @@ use File::Copy qw(move);
|
|||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = qw(Bootstrap::Step);
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
my @subSteps = ('Bump', 'Mozilla', 'l10n', 'Talkback');
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $tagDir = $config->Get('var' => 'tagDir');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $branchTag = $config->Get('var' => 'branchTag');
|
||||
my $pullDate = $config->Get('var' => 'pullDate');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
@ -33,8 +32,8 @@ sub Execute {
|
|||
|
||||
# create the main tag directory
|
||||
if (not -d $releaseTagDir) {
|
||||
MkdirWithPath('dir' => $releaseTagDir)
|
||||
or die "Cannot mkdir $releaseTagDir: $!";
|
||||
MkdirWithPath(dir => $releaseTagDir)
|
||||
or die("Cannot mkdir $releaseTagDir: $!");
|
||||
}
|
||||
|
||||
# Symlink to to RC dir
|
||||
|
@ -42,42 +41,42 @@ sub Execute {
|
|||
my $toLink = catfile($tagDir, $rcTag);
|
||||
if (not -e $toLink) {
|
||||
symlink($fromLink, $toLink)
|
||||
or die "Cannot symlink $fromLink $toLink: $!";
|
||||
or die("Cannot symlink $fromLink $toLink: $!");
|
||||
}
|
||||
|
||||
# Tagging area for Mozilla
|
||||
my $cvsrootTagDir = catfile($releaseTagDir, 'cvsroot');
|
||||
if (not -d $cvsrootTagDir) {
|
||||
MkdirWithPath('dir' => $cvsrootTagDir)
|
||||
or die "Cannot mkdir $cvsrootTagDir: $!";
|
||||
MkdirWithPath(dir => $cvsrootTagDir)
|
||||
or die("Cannot mkdir $cvsrootTagDir: $!");
|
||||
}
|
||||
|
||||
# Check out Mozilla from the branch you want to tag.
|
||||
# TODO this should support running without branch tag or pull date.
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mozillaCvsroot,
|
||||
'co',
|
||||
'-r', $branchTag,
|
||||
'-D', $pullDate,
|
||||
'mozilla/client.mk',
|
||||
],
|
||||
'dir' => $cvsrootTagDir,
|
||||
'logFile' => catfile($logDir, 'tag_checkout_client_mk.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot,
|
||||
'co',
|
||||
'-r', $branchTag,
|
||||
'-D', $pullDate,
|
||||
'mozilla/client.mk',
|
||||
],
|
||||
dir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, 'tag_checkout_client_mk.log'),
|
||||
);
|
||||
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir, 'tag_checkout_client_mk.log'),
|
||||
'checkForOnly' => '^U mozilla/client.mk',
|
||||
log => catfile($logDir, 'tag_checkout_client_mk.log'),
|
||||
checkForOnly => '^U mozilla/client.mk',
|
||||
);
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'gmake',
|
||||
'cmdArgs' => ['-f', 'client.mk', 'checkout', 'MOZ_CO_PROJECT=all',
|
||||
cmd => 'gmake',
|
||||
cmdArgs => ['-f', 'client.mk', 'checkout', 'MOZ_CO_PROJECT=all',
|
||||
'MOZ_CO_DATE=' . $pullDate],
|
||||
'dir' => catfile($cvsrootTagDir, 'mozilla'),
|
||||
'logFile' => catfile($logDir, 'tag_mozilla-checkout.log'),
|
||||
dir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag_mozilla-checkout.log'),
|
||||
);
|
||||
|
||||
# Call substeps
|
||||
|
@ -100,11 +99,12 @@ sub Execute {
|
|||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir, 'tag_mozilla-checkout.log'),
|
||||
'checkFor' => '^U',
|
||||
log => catfile($logDir, 'tag_mozilla-checkout.log'),
|
||||
checkFor => '^U',
|
||||
);
|
||||
|
||||
# Call substeps
|
||||
|
@ -128,6 +128,7 @@ sub CvsTag {
|
|||
my $this = shift;
|
||||
my %args = @_;
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $tagName = $args{'tagName'};
|
||||
my $coDir = $args{'coDir'};
|
||||
my $branch = $args{'branch'};
|
||||
|
@ -135,7 +136,7 @@ sub CvsTag {
|
|||
my $force = $args{'force'};
|
||||
my $logFile = $args{'logFile'};
|
||||
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
|
||||
# only force or branch specific files, not the whole tree
|
||||
if ($force and scalar(@{$files}) <= 0 ) {
|
||||
|
@ -159,10 +160,10 @@ sub CvsTag {
|
|||
push(@cmdArgs, @$files) if defined($files);
|
||||
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => \@cmdArgs,
|
||||
'dir' => $coDir,
|
||||
'logFile' => $logFile,
|
||||
cmd => 'cvs',
|
||||
cmdArgs => \@cmdArgs,
|
||||
dir => $coDir,
|
||||
logFile => $logFile,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,22 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $branchTag = $config->Get('var' => 'branchTag');
|
||||
my $pullDate = $config->Get('var' => 'pullDate');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $appName = $config->Get('var' => 'appName');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $tagDir = $config->Get('var' => 'tagDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $minibranchTag = $productTag.'_MINIBRANCH';
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
|
@ -31,54 +29,44 @@ sub Execute {
|
|||
my $cvsrootTagDir = catfile($releaseTagDir, 'cvsroot');
|
||||
|
||||
# pull version files
|
||||
my $moduleVer = $appName . '/app/module.ver';
|
||||
my $versionTxt = $appName . '/config/version.txt';
|
||||
my $moduleVer = catfile($appName, 'app', 'module.ver');
|
||||
my $versionTxt = catfile($appName, 'config', 'version.txt');
|
||||
my @bumpFiles = ('client.mk', $moduleVer, $versionTxt);
|
||||
|
||||
# Check out Mozilla from the branch you want to tag.
|
||||
# TODO this should support running without branch tag or pull date.
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mozillaCvsroot,
|
||||
'co',
|
||||
'-r', $branchTag,
|
||||
'-D', $pullDate,
|
||||
catfile('mozilla', 'client.mk'),
|
||||
catfile('mozilla', $moduleVer),
|
||||
catfile('mozilla', $versionTxt),
|
||||
],
|
||||
'dir' => $cvsrootTagDir,
|
||||
'logFile' => catfile($logDir, 'tag-bump_checkout.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot,
|
||||
'co',
|
||||
'-r', $branchTag,
|
||||
'-D', $pullDate,
|
||||
catfile('mozilla', 'client.mk'),
|
||||
catfile('mozilla', $moduleVer),
|
||||
catfile('mozilla', $versionTxt),
|
||||
],
|
||||
dir => $cvsrootTagDir,
|
||||
logFile => catfile($logDir, 'tag-bump_checkout.log'),
|
||||
);
|
||||
|
||||
# Create a minibranch for the pull scripts so we can change them without
|
||||
# changing anything on the original branch.
|
||||
$this->CvsTag(
|
||||
'tagName' => $minibranchTag,
|
||||
'branch' => '1',
|
||||
'files' => \@bumpFiles,
|
||||
'coDir' => catfile($cvsrootTagDir, 'mozilla'),
|
||||
'logFile' => catfile($logDir, 'tag-bump_cvsroot_tag-' . $minibranchTag . '.log'),
|
||||
);
|
||||
|
||||
# Update to the minibranch you just created.
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['up', '-r', $minibranchTag,
|
||||
@bumpFiles,
|
||||
],
|
||||
'dir' => catfile($cvsrootTagDir, 'mozilla'),
|
||||
'logFile' => catfile($logDir, 'tag-bump_update.log'),
|
||||
tagName => $minibranchTag,
|
||||
branch => '1',
|
||||
files => \@bumpFiles,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-bump_cvsroot_tag-' . $minibranchTag . '.log'),
|
||||
);
|
||||
|
||||
# pull version files from the version bump minibranch
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['up', '-r', $minibranchTag,
|
||||
@bumpFiles,
|
||||
],
|
||||
'dir' => catfile($cvsrootTagDir, 'mozilla'),
|
||||
'logFile' => catfile($logDir, 'tag-bump-pull_minibranch.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['up', '-r', $minibranchTag,
|
||||
@bumpFiles,
|
||||
],
|
||||
dir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-bump-pull_minibranch.log'),
|
||||
);
|
||||
|
||||
### Perform version bump
|
||||
|
@ -87,25 +75,29 @@ sub Execute {
|
|||
foreach my $file (catfile($parentDir, $moduleVer),
|
||||
catfile($parentDir, $versionTxt)) {
|
||||
my $found = 0;
|
||||
open(INFILE, "< $file") or die ("Could not open $file: $!");
|
||||
open(OUTFILE, "> $file.tmp") or die ("Could not open $file.tmp: $!");
|
||||
open(INFILE, "< $file") or die("Could not open $file: $!");
|
||||
open(OUTFILE, "> $file.tmp") or die("Could not open $file.tmp: $!");
|
||||
while(<INFILE>) {
|
||||
my $preVersion = $version . 'pre';
|
||||
if($_ =~ s/$preVersion/$version/) {
|
||||
$found = 1;
|
||||
}
|
||||
if($_ =~ /$preVersion/) {
|
||||
$found = 1;
|
||||
$_ =~ s/pre$//g;
|
||||
}
|
||||
|
||||
print OUTFILE $_;
|
||||
}
|
||||
close INFILE or die ("Could not close $file: $!");
|
||||
close OUTFILE or die ("Coule not close $file.tmp: $!");
|
||||
close INFILE or die("Could not close $file: $!");
|
||||
close OUTFILE or die("Coule not close $file.tmp: $!");
|
||||
if (not $found) {
|
||||
die("No " . $version . "pre in file $file: $!");
|
||||
}
|
||||
|
||||
if (not move("$file.tmp",
|
||||
"$file")) {
|
||||
die "Cannot rename $clientMk.tmp to $clientMk: $!";
|
||||
die("Cannot rename $clientMk.tmp to $clientMk: $!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,36 +121,38 @@ sub Execute {
|
|||
|
||||
if (not move("$clientMk.tmp",
|
||||
"$clientMk")) {
|
||||
die "Cannot rename $clientMk.tmp to $clientMk: $!";
|
||||
die("Cannot rename $clientMk.tmp to $clientMk: $!");
|
||||
}
|
||||
|
||||
my $bumpCiMsg = 'version bump, remove pre tag for '
|
||||
. $product . ' ' . $version . ' release on '
|
||||
. $minibranchTag;
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['commit', '-m', $bumpCiMsg,
|
||||
@bumpFiles,
|
||||
],
|
||||
'dir' => catfile($releaseTagDir, 'cvsroot', 'mozilla'),
|
||||
'logFile' => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['commit', '-m', $bumpCiMsg,
|
||||
@bumpFiles,
|
||||
],
|
||||
dir => catfile($releaseTagDir, 'cvsroot', 'mozilla'),
|
||||
logFile => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $appName = $config->Get('var' => 'appName');
|
||||
|
||||
my $moduleVer = $appName . '/app/module.ver';
|
||||
my $versionTxt = $appName . '/config/version.txt';
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
|
||||
my $moduleVer = catfile($appName, 'app', 'module.ver');
|
||||
my $versionTxt = catfile($appName, 'config', 'version.txt');
|
||||
my @bumpFiles = ('client.mk', $moduleVer, $versionTxt);
|
||||
|
||||
foreach my $file (@bumpFiles) {
|
||||
foreach my $rule ('^Checking in ' . $file, '^done') {
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
'checkFor' => $rule,
|
||||
log => catfile($logDir, 'tag-bump_checkin.log'),
|
||||
checkFor => $rule,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,24 +6,23 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $branchTag = $config->Get('var' => 'branchTag');
|
||||
my $pullDate = $config->Get('var' => 'pullDate');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $appName = $config->Get('var' => 'appName');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $tagDir = $config->Get('var' => 'tagDir');
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
@ -33,10 +32,10 @@ sub Execute {
|
|||
# Create the RELEASE and RC tags
|
||||
foreach my $tag ($releaseTag, $rcTag) {
|
||||
$this->CvsTag(
|
||||
'tagName' => $tag,
|
||||
'coDir' => catfile($cvsrootTagDir, 'mozilla'),
|
||||
'logFile' => catfile($logDir,
|
||||
'tag-mozilla_cvsroot_tag-' . $tag . '.log'),
|
||||
tagName => $tag,
|
||||
coDir => catfile($cvsrootTagDir, 'mozilla'),
|
||||
logFile => catfile($logDir,
|
||||
'tag-mozilla_cvsroot_tag-' . $tag . '.log'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -44,17 +43,18 @@ sub Execute {
|
|||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
||||
foreach my $tag ($releaseTag, $rcTag) {
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir, 'tag-mozilla_cvsroot_tag-' . $tag . '.log'),
|
||||
'checkFor' => '^T',
|
||||
log => catfile($logDir, 'tag-mozilla_cvsroot_tag-' . $tag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,22 +6,20 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $branchTag = $config->Get('var' => 'branchTag');
|
||||
my $pullDate = $config->Get('var' => 'pullDate');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $mofoCvsroot = $config->Get('var' => 'mofoCvsroot');
|
||||
my $tagDir = $config->Get('var' => 'tagDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $pullDate = $config->Get(var => 'pullDate');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $mofoCvsroot = $config->Get(var => 'mofoCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $releaseTagDir = catfile($tagDir, $releaseTag);
|
||||
|
@ -29,39 +27,41 @@ sub Execute {
|
|||
# Create the mofo tag directory.
|
||||
my $mofoDir = catfile($releaseTagDir, 'mofo');
|
||||
if (not -d $mofoDir) {
|
||||
MkdirWithPath('dir' => $mofoDir)
|
||||
or die "Cannot mkdir $mofoDir: $!";
|
||||
MkdirWithPath(dir => $mofoDir)
|
||||
or die("Cannot mkdir $mofoDir: $!");
|
||||
}
|
||||
|
||||
# Check out the talkback files from the branch you want to tag.
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mofoCvsroot, 'co', '-r', $branchTag, '-D',
|
||||
$pullDate, catfile('talkback', 'fullsoft')],
|
||||
'dir' => catfile($releaseTagDir, 'mofo'),
|
||||
'logFile' => catfile($logDir, 'tag-talkback_mofo-checkout.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mofoCvsroot, 'co', '-r', $branchTag, '-D',
|
||||
$pullDate, catfile('talkback', 'fullsoft')],
|
||||
dir => catfile($releaseTagDir, 'mofo'),
|
||||
logFile => catfile($logDir, 'tag-talkback_mofo-checkout.log'),
|
||||
);
|
||||
|
||||
# Create the talkback RELEASE tag.
|
||||
$this->CvsTag(
|
||||
'tagName' => $releaseTag,
|
||||
'coDir' => catfile($releaseTagDir, 'mofo', 'talkback', 'fullsoft'),
|
||||
'logFile' => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
tagName => $releaseTag,
|
||||
coDir => catfile($releaseTagDir, 'mofo', 'talkback', 'fullsoft'),
|
||||
logFile => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
);
|
||||
}
|
||||
|
||||
sub Verify {
|
||||
my $this = shift;
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
'checkFor' => '^T',
|
||||
log => catfile($logDir,
|
||||
'tag-talkback_mofo-tag-' . $releaseTag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,22 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
use Bootstrap::Step::Tag;
|
||||
use File::Copy qw(move);
|
||||
use File::Spec::Functions;
|
||||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step::Tag");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $branchTag = $config->Get('var' => 'branchTag');
|
||||
my $l10n_pullDate = $config->Get('var' => 'l10n_pullDate');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $appName = $config->Get('var' => 'appName');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $l10nCvsroot = $config->Get('var' => 'l10nCvsroot');
|
||||
my $tagDir = $config->Get('var' => 'tagDir');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $branchTag = $config->Get(var => 'branchTag');
|
||||
my $l10n_pullDate = $config->Get(var => 'l10n_pullDate');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
my $appName = $config->Get(var => 'appName');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $l10nCvsroot = $config->Get(var => 'l10nCvsroot');
|
||||
my $tagDir = $config->Get(var => 'tagDir');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
@ -32,17 +30,16 @@ sub Execute {
|
|||
# Create the l10n tag directory.
|
||||
my $l10nDir = catfile($releaseTagDir, 'l10n');
|
||||
if (not -d $l10nDir) {
|
||||
MkdirWithPath('dir' => $l10nDir)
|
||||
or die "Cannot mkdir $l10nDir: $!";
|
||||
MkdirWithPath(dir => $l10nDir) or die("Cannot mkdir $l10nDir: $!");
|
||||
}
|
||||
|
||||
# Grab list of shipped locales
|
||||
my $shippedLocales = catfile($releaseTagDir, 'cvsroot', 'mozilla',
|
||||
$appName, 'locales', 'shipped-locales');
|
||||
open (FILE, "< $shippedLocales")
|
||||
or die "Cannot open file $shippedLocales: $!";
|
||||
or die("Cannot open file $shippedLocales: $!");
|
||||
my @locales = <FILE>;
|
||||
close FILE or die "Cannot close file $shippedLocales: $!";
|
||||
close FILE or die("Cannot close file $shippedLocales: $!");
|
||||
|
||||
# Check out the l10n files from the branch you want to tag.
|
||||
for my $locale (@locales) {
|
||||
|
@ -55,20 +52,20 @@ sub Execute {
|
|||
next;
|
||||
}
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $l10nCvsroot, 'co', '-r', $branchTag, '-D',
|
||||
$l10n_pullDate, catfile('l10n', $locale)],
|
||||
'dir' => catfile($releaseTagDir, 'l10n'),
|
||||
'logFile' => catfile($logDir, 'tag-l10n_checkout.log'),
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $l10nCvsroot, 'co', '-r', $branchTag, '-D',
|
||||
$l10n_pullDate, catfile('l10n', $locale)],
|
||||
dir => catfile($releaseTagDir, 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_checkout.log'),
|
||||
);
|
||||
}
|
||||
|
||||
# Create the l10n RELEASE and RC tags.
|
||||
foreach my $tag ($releaseTag, $rcTag) {
|
||||
$this->CvsTag(
|
||||
'tagName' => $tag,
|
||||
'coDir' => catfile($releaseTagDir, 'l10n', 'l10n'),
|
||||
'logFile' => catfile($logDir, 'tag-l10n_tag_' . $tag. '.log'),
|
||||
tagName => $tag,
|
||||
coDir => catfile($releaseTagDir, 'l10n', 'l10n'),
|
||||
logFile => catfile($logDir, 'tag-l10n_tag_' . $tag. '.log'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -76,17 +73,18 @@ sub Execute {
|
|||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $rc = $config->Get('var' => 'rc');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
my $rc = $config->Get(var => 'rc');
|
||||
|
||||
my $releaseTag = $productTag.'_RELEASE';
|
||||
my $rcTag = $productTag.'_RC'.$rc;
|
||||
|
||||
foreach my $tag ($releaseTag, $rcTag) {
|
||||
$this->CheckLog(
|
||||
'log' => catfile($logDir, 'tag-l10n_tag_' . $tag . '.log'),
|
||||
'checkFor' => '^T',
|
||||
log => catfile($logDir, 'tag-l10n_tag_' . $tag . '.log'),
|
||||
checkFor => '^T',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,51 +9,60 @@ use File::Find qw(find);
|
|||
use MozBuild::Util qw(MkdirWithPath);
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $mofoCvsroot = $config->Get('var' => 'mofoCvsroot');
|
||||
my $updateDir = $config->Get('var' => 'updateDir');
|
||||
my $patcherConfig = $config->Get('var' => 'patcherConfig');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $mofoCvsroot = $config->Get(var => 'mofoCvsroot');
|
||||
my $updateDir = $config->Get(var => 'updateDir');
|
||||
my $patcherConfig = $config->Get(var => 'patcherConfig');
|
||||
|
||||
# Create updates area.
|
||||
if (not -d $updateDir) {
|
||||
MkdirWithPath('dir' => $updateDir)
|
||||
or die "Cannot mkdir $updateDir: $!";
|
||||
MkdirWithPath(dir => $updateDir)
|
||||
or die("Cannot mkdir $updateDir: $!");
|
||||
}
|
||||
|
||||
# check out patcher
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mozillaCvsroot, 'co', '-d', 'patcher',
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', 'patcher',
|
||||
catfile('mozilla', 'tools', 'patcher')],
|
||||
'logFile' => catfile($logDir, 'updates_patcher-checkout.log'),
|
||||
'dir' => $updateDir,
|
||||
logFile => catfile($logDir, 'updates_patcher-checkout.log'),
|
||||
dir => $updateDir,
|
||||
);
|
||||
|
||||
# check out utilities
|
||||
$this->Shell(
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', 'patcher/MozBuild',
|
||||
catfile('mozilla', 'tools', 'release', 'MozBuild')],
|
||||
logFile => catfile($logDir, 'updates_patcher-utils-checkout.log'),
|
||||
dir => $updateDir,
|
||||
);
|
||||
|
||||
# config lives in private repo
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mofoCvsroot, 'co', '-d', 'config',
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mofoCvsroot, 'co', '-d', 'config',
|
||||
catfile('release', 'patcher', $patcherConfig)],
|
||||
'logFile' => catfile($logDir, 'updates_patcher-config-checkout.log'),
|
||||
'dir' => $updateDir,
|
||||
logFile => catfile($logDir, 'updates_patcher-config-checkout.log'),
|
||||
dir => $updateDir,
|
||||
);
|
||||
|
||||
# build tools
|
||||
my $originalCvsrootEnv = $ENV{'CVSROOT'};
|
||||
$ENV{'CVSROOT'} = $mozillaCvsroot;
|
||||
$this->Shell(
|
||||
'cmd' => './patcher2.pl',
|
||||
'cmdArgs' => ['--build-tools', '--app=' . $product,
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--build-tools', '--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig],
|
||||
'logFile' => catfile($logDir, 'updates_patcher-build-tools.log'),
|
||||
'dir' => catfile($updateDir, 'patcher'),
|
||||
logFile => catfile($logDir, 'updates_patcher-build-tools.log'),
|
||||
dir => catfile($updateDir, 'patcher'),
|
||||
);
|
||||
if ($originalCvsrootEnv) {
|
||||
$ENV{'CVSROOT'} = $originalCvsrootEnv;
|
||||
|
@ -61,21 +70,21 @@ sub Execute {
|
|||
|
||||
# download complete MARs
|
||||
$this->Shell(
|
||||
'cmd' => './patcher2.pl',
|
||||
'cmdArgs' => ['--download', '--app=' . $product,
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--download', '--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig],
|
||||
'logFile' => catfile($logDir, 'updates_patcher-download.log'),
|
||||
'dir' => catfile($updateDir, 'patcher'),
|
||||
logFile => catfile($logDir, 'updates_patcher-download.log'),
|
||||
dir => catfile($updateDir, 'patcher'),
|
||||
);
|
||||
|
||||
# Create partial patches and snippets
|
||||
$this->Shell(
|
||||
'cmd' => './patcher2.pl',
|
||||
'cmdArgs' => ['--create-patches', '--app=' . $product,
|
||||
cmd => './patcher2.pl',
|
||||
cmdArgs => ['--create-patches', '--app=' . $product,
|
||||
'--config=../config/' . $patcherConfig],
|
||||
'logFile' => catfile($logDir, 'updates_patcher-create-patches.log'),
|
||||
'dir' => catfile($updateDir, 'patcher'),
|
||||
'timeout' => 18000,
|
||||
logFile => catfile($logDir, 'updates_patcher-create-patches.log'),
|
||||
dir => catfile($updateDir, 'patcher'),
|
||||
timeout => 18000,
|
||||
);
|
||||
|
||||
### quick verification
|
||||
|
@ -89,37 +98,38 @@ sub Execute {
|
|||
sub Verify {
|
||||
my $this = shift;
|
||||
|
||||
my $logDir = $config->Get('var' => 'logDir');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $oldVersion = $config->Get('var' => 'oldVersion');
|
||||
my $mozillaCvsroot = $config->Get('var' => 'mozillaCvsroot');
|
||||
my $updateDir = $config->Get('var' => 'updateDir');
|
||||
my $verifyDir = $config->Get('var' => 'verifyDir');
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $logDir = $config->Get(var => 'logDir');
|
||||
my $version = $config->Get(var => 'version');
|
||||
my $oldVersion = $config->Get(var => 'oldVersion');
|
||||
my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
|
||||
my $updateDir = $config->Get(var => 'updateDir');
|
||||
my $verifyDir = $config->Get(var => 'verifyDir');
|
||||
my $product = $config->Get(var => 'product');
|
||||
|
||||
# Create verification area.
|
||||
my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
|
||||
MkdirWithPath('dir' => $verifyDirVersion)
|
||||
MkdirWithPath(dir => $verifyDirVersion)
|
||||
or die("Could not mkdir $verifyDirVersion: $!");
|
||||
|
||||
foreach my $dir ('updates', 'common') {
|
||||
$this->Shell(
|
||||
'cmd' => 'cvs',
|
||||
'cmdArgs' => ['-d', $mozillaCvsroot, 'co', '-d', $dir,
|
||||
cmd => 'cvs',
|
||||
cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', $dir,
|
||||
catfile('mozilla', 'testing', 'release', $dir)],
|
||||
'logFile' => catfile($logDir,
|
||||
logFile => catfile($logDir,
|
||||
'updates_verify_checkout-' . $dir . '.log'),
|
||||
'dir' => $verifyDirVersion,
|
||||
dir => $verifyDirVersion,
|
||||
);
|
||||
}
|
||||
|
||||
# Customize updates.cfg to contain the channels you are interested in
|
||||
# testing.
|
||||
$this->Shell(
|
||||
'cmd' => './verify.sh',
|
||||
'cmdArgs' => ['-c'],
|
||||
'logFile' => catfile($logDir, 'updates_verify.log'),
|
||||
'dir' => catfile($verifyDirVersion, 'updates'),
|
||||
cmd => './verify.sh',
|
||||
cmdArgs => ['-c'],
|
||||
logFile => catfile($logDir, 'updates_verify.log'),
|
||||
dir => catfile($verifyDirVersion, 'updates'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -135,8 +145,9 @@ sub TestAusCallback {
|
|||
sub Announce {
|
||||
my $this = shift;
|
||||
|
||||
my $product = $config->Get('var' => 'product');
|
||||
my $version = $config->Get('var' => 'version');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $product = $config->Get(var => 'product');
|
||||
my $version = $config->Get(var => 'version');
|
||||
|
||||
$this->SendAnnouncement(
|
||||
subject => "$product $version update step finished",
|
||||
|
|
|
@ -44,10 +44,10 @@ sub RunShellCommand {
|
|||
my %args = @_;
|
||||
|
||||
my $shellCommand = $args{'command'};
|
||||
die 'ASSERT: RunShellCommand(): Empty command.'
|
||||
die('ASSERT: RunShellCommand(): Empty command.')
|
||||
if (not(defined($shellCommand)) || $shellCommand =~ /^\s+$/);
|
||||
my $commandArgs = $args{'args'};
|
||||
die 'ASSERT: RunShellCommand(): commandArgs not an array ref.'
|
||||
die('ASSERT: RunShellCommand(): commandArgs not an array ref.')
|
||||
if (defined($commandArgs) && ref($commandArgs) ne 'ARRAY');
|
||||
|
||||
my $logfile = $args{'logfile'};
|
||||
|
@ -67,7 +67,7 @@ sub RunShellCommand {
|
|||
$shellCommand =~ s/^\s+//;
|
||||
$shellCommand =~ s/\s+$//;
|
||||
|
||||
die "ASSERT: old RunShellCommand() calling convention detected\n"
|
||||
die("ASSERT: old RunShellCommand() calling convention detected\n")
|
||||
if ($shellCommand =~ /\s+/);
|
||||
}
|
||||
|
||||
|
@ -103,13 +103,13 @@ sub RunShellCommand {
|
|||
my $childStartedTime = 0;
|
||||
|
||||
if (defined($changeToDir)) {
|
||||
chdir($changeToDir) or die "RunShellCommand(): failed to chdir() to "
|
||||
. "$changeToDir\n";
|
||||
chdir($changeToDir) or die("RunShellCommand(): failed to chdir() to "
|
||||
. "$changeToDir\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
local $SIG{'ALRM'} = sub { die "alarm\n" };
|
||||
local $SIG{'PIPE'} = sub { die "pipe\n" };
|
||||
local $SIG{'ALRM'} = sub { die("alarm\n") };
|
||||
local $SIG{'PIPE'} = sub { die("pipe\n") };
|
||||
|
||||
my @execCommand = ($shellCommand);
|
||||
push(@execCommand, @{$commandArgs}) if (defined($commandArgs) &&
|
||||
|
@ -144,8 +144,8 @@ sub RunShellCommand {
|
|||
if (defined($logfile)) {
|
||||
my $openArg = $appendLogfile ? '>>' : '>';
|
||||
open(LOGFILE, $openArg . $logfile) or
|
||||
die 'Could not ' . $appendLogfile ? 'append' : 'open' .
|
||||
" logfile $logfile: $!";
|
||||
die('Could not ' . $appendLogfile ? 'append' : 'open' .
|
||||
" logfile $logfile: $!");
|
||||
LOGFILE->autoflush(1);
|
||||
}
|
||||
|
||||
|
@ -198,20 +198,20 @@ sub RunShellCommand {
|
|||
}
|
||||
}
|
||||
|
||||
die 'ASSERT: RunShellCommand(): stdout handle not empty'
|
||||
die('ASSERT: RunShellCommand(): stdout handle not empty')
|
||||
if ($childOut->sysread(undef, $EXEC_IO_READINCR) != 0);
|
||||
die 'ASSERT: RunShellCommand(): stderr handle not empty;'
|
||||
die('ASSERT: RunShellCommand(): stderr handle not empty')
|
||||
if ($childErr->sysread(undef, $EXEC_IO_READINCR) != 0);
|
||||
};
|
||||
|
||||
if (defined($logfile)) {
|
||||
close(LOGFILE) or die "Could not close logfile $logfile: $!";
|
||||
close(LOGFILE) or die("Could not close logfile $logfile: $!");
|
||||
}
|
||||
|
||||
if ($@) {
|
||||
if ($@ eq "alarm\n") {
|
||||
$timedOut = 1;
|
||||
kill(9, $childPid) or die "Could not kill timed-out $childPid: $!";
|
||||
kill(9, $childPid) or die("Could not kill timed-out $childPid: $!");
|
||||
warn "Shell command $shellCommand timed out, PID $childPid killed: $@\n";
|
||||
} else {
|
||||
warn "Error running $shellCommand: $@\n";
|
||||
|
@ -251,7 +251,7 @@ sub MkdirWithPath {
|
|||
$dirMask = $args{'dirMask'};
|
||||
}
|
||||
|
||||
die "ASSERT: MkdirWithPath() needs an arg" if not defined($dirToCreate);
|
||||
die("ASSERT: MkdirWithPath() needs an arg") if not defined($dirToCreate);
|
||||
|
||||
## Defaults based on what mkpath does...
|
||||
$printProgress = defined($printProgress) ? $printProgress : 0;
|
||||
|
@ -293,7 +293,7 @@ sub HashFile {
|
|||
if ($ignoreErrors) {
|
||||
return '';
|
||||
} else {
|
||||
die "MozUtil::HashFile(): hash call failed: $rv->{'exitValue'}\n";
|
||||
die("MozUtil::HashFile(): hash call failed: $rv->{'exitValue'}\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -314,6 +314,8 @@ sub Email {
|
|||
my $ccList = $args{'cc'} ? $args{'cc'} : '';
|
||||
my $subject = $args{'subject'};
|
||||
my $message = $args{'message'};
|
||||
my $sendmail = $args{'sendmail'};
|
||||
my $blat = $args{'blat'};
|
||||
|
||||
if (not defined($from)) {
|
||||
die("ASSERT: MozBuild::Utils::Email(): from is required");
|
||||
|
@ -326,31 +328,32 @@ sub Email {
|
|||
}
|
||||
|
||||
if (defined($ccList) and ref($ccList) ne 'ARRAY') {
|
||||
die "ASSERT: MozBuild::Utils::Email(): ccList is not an array ref\n"
|
||||
die("ASSERT: MozBuild::Utils::Email(): ccList is not an array ref\n");
|
||||
}
|
||||
|
||||
my $sendmailBinary = '/usr/lib/sendmail';
|
||||
my $blatBinary = 'c:\moztools\blat.exe';
|
||||
|
||||
if (-f $sendmailBinary) {
|
||||
open(SENDMAIL, "|$sendmailBinary -oi -t")
|
||||
or die "Can’t fork for sendmail: $!\n";
|
||||
} elsif(-f $blatBinary) {
|
||||
open(SENDMAIL, "|$blatBinary")
|
||||
or die "Can’t fork for blat: $!\n";
|
||||
if (-f $sendmail) {
|
||||
open(SENDMAIL, "|$sendmail -oi -t")
|
||||
or die("Can’t fork for sendmail: $!\n");
|
||||
print SENDMAIL "From: $from\n";
|
||||
print SENDMAIL "To: $to\n";
|
||||
foreach my $cc (@{$ccList}) {
|
||||
print SENDMAIL "CC: $cc\n";
|
||||
}
|
||||
print SENDMAIL "Subject: $subject\n\n";
|
||||
} elsif(-f $blat) {
|
||||
my $toList = $to;
|
||||
foreach my $cc (@{$ccList}) {
|
||||
$toList .= ',';
|
||||
$toList .= $cc;
|
||||
}
|
||||
open(SENDMAIL, "|$blat -to $toList -subject \"$subject\"")
|
||||
or die("Can’t fork for blat: $!\n");
|
||||
} else {
|
||||
die("ASSERT: cannot find $sendmailBinary or $blatBinary");
|
||||
die("ASSERT: cannot find $sendmail or $blat");
|
||||
}
|
||||
|
||||
print SENDMAIL "From: $from\n";
|
||||
print SENDMAIL "To: $to\n";
|
||||
foreach my $cc (@{$ccList}) {
|
||||
print SENDMAIL "CC: $cc\n";
|
||||
}
|
||||
print SENDMAIL "Subject: $subject\n\n";
|
||||
print SENDMAIL "$message";
|
||||
close(SENDMAIL) or warn "sendmail didn’t close nicely: $!";
|
||||
|
||||
}
|
||||
|
||||
sub DownloadFile {
|
||||
|
@ -358,7 +361,7 @@ sub DownloadFile {
|
|||
|
||||
my $sourceUrl = $args{'url'};
|
||||
|
||||
die "ASSERT: DownloadFile() Invalid Source URL: $sourceUrl\n"
|
||||
die("ASSERT: DownloadFile() Invalid Source URL: $sourceUrl\n")
|
||||
if (not(defined($sourceUrl)) || $sourceUrl !~ m|^http://|);
|
||||
|
||||
my @wgetArgs = ();
|
||||
|
@ -381,8 +384,8 @@ sub DownloadFile {
|
|||
args => \@wgetArgs);
|
||||
|
||||
if ($rv->{'timedOut'} || $rv->{'exitValue'} != 0) {
|
||||
die "DownloadFile(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n";
|
||||
die("DownloadFile(): FAILED: $rv->{'exitValue'}," .
|
||||
" output: $rv->{'output'}\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,3 +23,5 @@ from = Bootstrap <build@example.com>
|
|||
to = engineer@example.com
|
||||
cc = interested_users@example.com, others@example.com
|
||||
patcherConfig = moz180-branch-patcher2.cfg
|
||||
blat = /cygdrive/d/moztools/bin/blat.exe
|
||||
sendmail = /usr/lib/sendmail
|
||||
|
|
|
@ -88,7 +88,7 @@ sub DetermineSteps() {
|
|||
|
||||
while ($currentStep < scalar(@allSteps)) {
|
||||
my $stepName = $allSteps[$currentStep];
|
||||
PerformStep( 'stepName' => $stepName );
|
||||
PerformStep( stepName => $stepName );
|
||||
$currentStep += 1;
|
||||
if (defined($config{'only'})) {
|
||||
if ($config{'only'} eq $stepName) {
|
||||
|
@ -127,21 +127,26 @@ sub PerformStep {
|
|||
}
|
||||
};
|
||||
if ($@) {
|
||||
print "Step $stepName died: $@";
|
||||
my $conf = new Bootstrap::Config;
|
||||
my $error = $@;
|
||||
print "Step $stepName died: $error";
|
||||
my $conf = new Bootstrap::Config();
|
||||
my $from = $conf->Get(var => 'from');
|
||||
my $to = $conf->Get(var => 'to');
|
||||
my $cc = $conf->Get(var => 'cc');
|
||||
my $blat = $conf->Get(var => 'blat');
|
||||
my $sendmail = $conf->Get(var => 'sendmail');
|
||||
|
||||
my @ccList = split(', ', $cc);
|
||||
|
||||
eval {
|
||||
Email(
|
||||
blat => $blat,
|
||||
sendmail => $sendmail,
|
||||
from => $from,
|
||||
to => $to,
|
||||
cc => \@ccList,
|
||||
subject => "Step $stepName died: $@",
|
||||
message => "Step $stepName died: $@\nSee the release.log for more information.",
|
||||
subject => "Step $stepName died: $error",
|
||||
message => "Step $stepName died: $error\nSee the release.log for more information.",
|
||||
);
|
||||
exit(1);
|
||||
};
|
||||
|
|
|
@ -3,21 +3,20 @@ use Bootstrap::Step;
|
|||
use Bootstrap::Config;
|
||||
@ISA = ("Bootstrap::Step");
|
||||
|
||||
my $config = new Bootstrap::Config;
|
||||
|
||||
sub Execute {
|
||||
my $this = shift;
|
||||
|
||||
my $productTag = $config->Get('var' => 'productTag');
|
||||
my $config = new Bootstrap::Config();
|
||||
my $productTag = $config->Get(var => 'productTag');
|
||||
|
||||
if (not $productTag) {
|
||||
print("testfailed, could not get productTag var from Config: $!\n");
|
||||
}
|
||||
|
||||
eval {
|
||||
$this->Shell('cmd' => 'echo',
|
||||
'cmdArgs' => ['success'],
|
||||
'logFile' => 't/test.log'
|
||||
$this->Shell(cmd => 'echo',
|
||||
cmdArgs => ['success'],
|
||||
logFile => 't/test.log'
|
||||
);
|
||||
};
|
||||
if ($@) {
|
||||
|
@ -26,8 +25,8 @@ sub Execute {
|
|||
|
||||
eval {
|
||||
$this->CheckLog(
|
||||
'log' => './t/test.log',
|
||||
'checkForOnly' => '^success',
|
||||
log => './t/test.log',
|
||||
checkForOnly => '^success',
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -37,7 +36,7 @@ sub Execute {
|
|||
|
||||
|
||||
eval {
|
||||
$this->Shell( 'cmd' => 'true', logFile => 't/test.log' );
|
||||
$this->Shell( cmd => 'true', logFile => 't/test.log' );
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
|
@ -45,7 +44,7 @@ sub Execute {
|
|||
}
|
||||
|
||||
eval {
|
||||
$this->Shell( 'cmd' => 'false', logFile => 't/test.log' );
|
||||
$this->Shell( cmd => 'false', logFile => 't/test.log' );
|
||||
};
|
||||
|
||||
if (not $@) {
|
||||
|
@ -54,8 +53,8 @@ sub Execute {
|
|||
|
||||
eval {
|
||||
$this->CheckLog(
|
||||
'log' => './t/test.log',
|
||||
'checkFor' => '^success',
|
||||
log => './t/test.log',
|
||||
checkFor => '^success',
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -68,8 +67,8 @@ sub Execute {
|
|||
sub Verify {
|
||||
my $this = shift;
|
||||
$this->Shell(
|
||||
'cmd' => 'echo', 'cmdArgs' => ['Verify', 'tag'], logFile => 't/test.log');
|
||||
$this->Log('msg' => 'finished');
|
||||
cmd => 'echo', cmdArgs => ['Verify', 'tag'], logFile => 't/test.log');
|
||||
$this->Log(msg => 'finished');
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче