step changes for bootstrap b=356185 r=preed

git-svn-id: svn://10.0.0.236/trunk@215065 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rhelmer%mozilla.com 2006-11-09 23:25:07 +00:00
parent 37381b5dd7
commit 7f9943721c
8 changed files with 648 additions and 12 deletions

View File

@ -1,15 +1,55 @@
#
# Build step. Calls tinderbox to produce en-US Firefox build.
#
package Bootstrap::Step::Build;
use Bootstrap::Step;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo build');
my $buildDir = $this->Config('var' => 'buildDir');
my $productTag = $this->Config('var' => 'productTag');
my $rc = $this->Config('var' => 'rc');
my $buildPlatform = $this->Config('var' => 'buildPlatform');
my $logDir = $this->Config('var' => 'logDir');
my $rcTag = $productTag . '_RC' . $rc;
my $lastBuilt = $buildDir . '/' . $buildPlatform . '/last-built';
unlink($lastBuilt)
or $this->Log('msg' => "Cannot unlink last-built file $lastBuilt: $!");
$this->Log('msg' => "Unlinked $lastBuilt");
my $buildLog = $logDir . '/' . $rcTag . '-build.log';
$this->Shell(
'cmd' => './build-seamonkey.pl --once --mozconfig mozconfig --depend --config-cvsup-dir ' . $buildDir . '/tinderbox-configs',
'dir' => $buildDir,
'logFile' => $buildLog,
'timeout' => 36000
);
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify build');
my $buildDir = $this->Config('var' => 'buildDir');
my $productTag = $this->Config('var' => 'productTag');
my $rc = $this->Config('var' => 'rc');
my $rcTag = $productTag.'_RC'.$rc;
my $logDir = $this->Config('var' => 'logDir');
my $buildLog = $logDir . '/' . $rcTag . '-build.log';
$this->CheckLog(
'log' => $buildLog,
'notAllowed' => 'tinderbox: status: failed',
);
# $this->CheckLog(
# 'log' => $buildLog,
# 'notAllowed' => '^Error:',
# );
}
1;

View File

@ -1,3 +1,6 @@
#
# Release step. Pushes bits to production.
#
package Bootstrap::Step::Release;
use Bootstrap::Step;
@ISA = ("Bootstrap::Step");

View File

@ -1,15 +1,51 @@
#
# Repack step. Unpacks, modifies, repacks a Firefox en-US build.
# Primary use is for l10n (localization) builds.
#
package Bootstrap::Step::Repack;
use Bootstrap::Step;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo repack');
my $buildDir = $this->Config('var' => 'l10n-buildDir');
my $productTag = $this->Config('var' => 'productTag');
my $rc = $this->Config('var' => 'rc');
my $logDir = $this->Config('var' => 'logDir');
my $buildPlatform = $this->Config('var' => 'buildPlatform');
my $rcTag = $productTag . '_RC' . $rc;
my $buildLog = $logDir . '/' . $rcTag . '-build-l10n.log';
my $lastBuilt = $buildDir . '/' . $buildPlatform . '/last-built';
unlink($lastBuilt)
or $this->Log('msg' => "Cannot unlink last-built file $lastBuilt: $!");
$this->Log('msg' => "Unlinked $lastBuilt");
$this->Shell(
'cmd' => './build-seamonkey.pl --once --mozconfig mozconfig --depend --config-cvsup-dir ' . $buildDir . '/tinderbox-configs',
'dir' => $buildDir,
'logFile' => $buildLog,
'timeout' => 36000
);
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify repack');
my $buildDir = $this->Config('var' => 'buildDir');
my $productTag = $this->Config('var' => 'productTag');
my $rc = $this->Config('var' => 'rc');
my $rcTag = $productTag.'_RC'.$rc;
my $logDir = $this->Config('var' => 'logDir');
my $buildLog = $logDir . '/' . $rcTag . '-build.log';
# XXX temp disabled
# $this->CheckLog(
# 'log' => $buildLog,
# 'notAllowed' => 'failed',
# );
}
1;

View File

@ -1,3 +1,6 @@
#
# Sign step. Applies digital signatures to builds.
#
package Bootstrap::Step::Sign;
use Bootstrap::Step;
@ISA = ("Bootstrap::Step");

View File

@ -1,15 +1,49 @@
#
# Source step. Creates a source tarball equivalent to what was used to
# build the binary release, in the Build step.
#
package Bootstrap::Step::Source;
use Bootstrap::Step;
use File::Copy;
use MozBuild::Util;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo source');
my $product = $this->Config('var' => 'product');
my $productTag = $this->Config('var' => 'productTag');
my $version = $this->Config('var' => 'version');
my $rc = $this->Config('var' => 'rc');
my $logDir = $this->Config('var' => 'logDir');
my $stageHome = $this->Config('var' => 'stageHome');
# create staging area
my $stageDir =
$stageHome . '/' . $product . '-' . $version . '/batch-source/rc' . $rc;
if (not -d $stageDir) {
MkdirWithPath('dir' => $stageDir) or die "Cannot create $stageDir: $!";
}
$this->Shell(
'cmd' => $stageHome . '/bin/' . $product . '-src-tarball-nobuild -r ' . $productTag . '_RELEASE -m ' . $version,
'dir' => $stageDir,
'logFile' => $logDir . '/source.log',
);
File::Copy::move("$stageDir/../*.bz2", $stageDir);
chmod(0644, glob("$stageDir/*.bz2"));
# $this->Shell(
# 'cmd' => 'rsync -av *.bz2 /home/ftp/pub/' . $product . '/nightly/' . $version . '-candidates/rc' . $rc,
# 'dir' => $stageDir,
# );
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify source');
#$this->Shell('cmd' => 'echo Verify source');
}
1;

View File

@ -1,15 +1,163 @@
#
# Stage step. Copies nightly build format filenames to release directory
# structure.
#
package Bootstrap::Step::Stage;
use Bootstrap::Step;
use File::Copy;
use File::Find;
use MozBuild::Util;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo stage');
my $product = $this->Config('var' => 'product');
my $version = $this->Config('var' => 'version');
my $rc = $this->Config('var' => 'rc');
my $logDir = $this->Config('var' => 'logDir');
my $stageHome = $this->Config('var' => 'stageHome');
## Prepare the staging directory for the release.
# Create the staging directory.
my $stageDir = $stageHome . '/' . $product . '-' . $version;
my $mergeDir = $stageDir . '/stage-merged';
if (not -d $stageDir) {
MkdirWithPath('dir' => $stageDir)
or die "Could not mkdir $stageDir: $!";
}
# Create skeleton batch directory.
my $skelDir = "$stageDir/batch-skel/stage";
if (not -d "$skelDir") {
MkdirWithPath('dir' => $skelDir) or die "Cannot create $stageDir: $!";
}
# Create the contrib and contrib-localized directories with expected
# access rights.
if (not -d "$skelDir/contrib") {
MkdirWithPath('dir' => "$skelDir/contrib")
or die "Could not mkdir $skelDir/contrib: $!";
}
my ($pwname, $pass, $uid) = getpwnam('cltbld')
or die "Could not getpwname for cltbld: $!";
my ($grname, $passwd, $gid) = getgrnam($product)
or die "Could not getgrname for $product: $!";
my @dir = ("$skelDir/contrib");
chmod('2775', @dir)
or die "Cannot change mode on $skelDir/contrib to 2775: $!";
# NOTE - should have a standard "master" copy somewhere else
# Copy the KEY file from the previous release directory.
File::Copy::copy("$product/releases/1.5/KEY", "$skelDir/");
## Prepare the merging directory.
$this->Shell(
'cmd' => 'rsync -av batch-skel/stage/ stage-merged/',
'logFile' => $logDir . '/stage-merge_skel.log',
'dir' => $stageDir,
);
# Collect the release files onto stage.mozilla.org.
if (not -d "$stageDir/batch1/prestage") {
MkdirWithPath('dir' => "$stageDir/batch1/prestage")
or die "Cannot create $stageDir/batch1/prestage: $!";
}
$this->Shell(
'cmd' => 'rsync -Lav /home/ftp/pub/' . $product . '/nightly/' . $version . '-candidates/rc' . $rc . '/ ./',
'logFile' => $logDir . '/stage-collect.log',
'dir' => $stageDir . '/batch1/prestage',
);
# Remove unreleased builds
$this->Shell(
'cmd' => 'rsync -av prestage/ prestage-trimmed/',
'logFile' => $logDir . '/stage-collect_trimmed.log',
'dir' => $stageDir . '/batch1/',
);
# Remove unshipped files and set proper mode on dirs
File::Find::find(\&TrimCallback, $stageDir . '/batch1/prestage-trimmed/');
$this->Shell(
'cmd' => 'rsync -Lav prestage-trimmed/ stage/',
'logFile' => $logDir . '/stage-collect_stage.log',
'dir' => $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' => $stageHome . '/bin/groom-files --short=' . $version . ' .',
'logFile' => $logDir . '/groom-files.log',
'dir' => $stageDir . '/batch1/stage',
);
# fix xpi dir names
File::Copy::move("$stageDir/batch1/stage/linux-xpi",
"$stageDir/batch1/stage/linux-i686/xpi")
or die "Cannot rename $stageDir/batch1/stage/linux-xpi $stageDir/batch1/stage/linux-i686/xpi: $!";
File::Copy::move("$stageDir/batch1/stage/windows-xpi",
"$stageDir/batch1/stage/win32/xpi")
or die "Cannot rename $stageDir/batch1/stage/windows-xpi $stageDir/batch1/stage/win32/xpi: $!";
File::Copy::move("$stageDir/batch1/stage/mac-xpi",
"$stageDir/batch1/stage/mac/xpi")
or die "Cannot rename $stageDir/batch1/stage/mac-xpi $stageDir/batch1/stage/mac/xpi: $!";
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify stage');
my $product = $this->Config('var' => 'product');
my $appName = $this->Config('var' => 'appName');
my $logDir = $this->Config('var' => 'logDir');
my $version = $this->Config('var' => 'version');
my $rc = $this->Config('var' => 'rc');
my $stageHome = $this->Config('var' => 'stageHome');
## Prepare the staging directory for the release.
# Create the staging directory.
my $stageDir = $stageHome . '/' . $product . '-' . $version;
# Verify locales
$this->Shell(
'cmd' => $stageHome . '/bin/verify-locales.pl -m ' . $stageDir . '/batch-source/rc' . $rc . '/mozilla/' . $appName . '/locales/shipped-locales',
'logFile' => $logDir . '/stage-verify_l10n.log',
'dir' => $stageDir . '/batch1/stage',
);
}
sub TrimCallback {
my $dirent = $File::Find::name;
if (-f $dirent) {
if (($dirent =~ /xforms\.xpi/) ||
# ja-JP-mac is the JA locale for mac, do not ship ja
($dirent =~ /ja\.mac/) ||
# ja is the JA locale for win32/linux, do not ship ja-JP-mac
($dirent =~ /ja-JP-mac\.win32/) ||
($dirent =~ /ja-JP-mac\.linux/) ||
($dirent =~ /^windows-xpi\/ja-JP-mac\.xpi$/) ||
($dirent =~ /^linux-xpi\/ja-JP-mac\.xpi$/) ||
# MAR files are merged in later
($dirent =~ /\.mar$/) ||
# ZIP files are not shipped
($dirent =~ /en-US\.xpi$/)) {
unlink($dirent) || die "Could not unlink $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");
}
}
1;

View File

@ -1,15 +1,267 @@
#
# Tag step. Applies a CVS tag to the appropriate repositories.
#
package Bootstrap::Step::Tag;
use Bootstrap::Step;
use File::Copy;
use MozBuild::Util;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo tag');
my $product = $this->Config('var' => 'product');
my $productTag = $this->Config('var' => 'productTag');
my $branchTag = $this->Config('var' => 'branchTag');
my $pullDate = $this->Config('var' => 'pullDate');
my $rc = $this->Config('var' => 'rc');
my $version = $this->Config('var' => 'version');
my $appName = $this->Config('var' => 'appName');
my $logDir = $this->Config('var' => 'logDir');
my $mozillaCvsroot = $this->Config('var' => 'mozillaCvsroot');
my $l10nCvsroot = $this->Config('var' => 'l10nCvsroot');
my $mofoCvsroot = $this->Config('var' => 'mofoCvsroot');
my $tagDir = $this->Config('var' => 'tagDir');
my $releaseTag = $productTag.'_RELEASE';
my $rcTag = $productTag.'_RC'.$rc;
my $minibranchTag = $productTag.'_MINIBRANCH';
my $releaseTagDir = $tagDir . '/' . $releaseTag;
# create the main tag directory
if (not -d $releaseTagDir) {
MkdirWithPath('dir' => $releaseTagDir)
or die "Cannot mkdir $releaseTagDir: $!";
}
# Symlink to to RC dir
my $fromLink = $tagDir . '/' . $releaseTag;
my $toLink = $tagDir . '/' . $rcTag;
if (not -e $toLink) {
symlink($fromLink, $toLink)
or die "Cannot symlink $fromLink $toLink: $!";
}
# Tagging area for Mozilla
if (not -d $releaseTagDir . '/cvsroot') {
MkdirWithPath('dir' => $releaseTagDir . '/cvsroot')
or die "Cannot mkdir $releaseTagDir/cvsroot: $!";
}
# 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 -d ' . $mozillaCvsroot . ' co -r ' . $branchTag . ' -D "' . $pullDate . '" mozilla/client.mk ',
'dir' => $releaseTagDir . '/cvsroot',
'logFile' => $logDir . '/client_mk.log',
);
$this->CheckLog(
'log' => $logDir . '/client_mk.log',
'checkForOnly' => '^U mozilla/client.mk',
);
$this->Shell(
'cmd' => 'gmake -f client.mk checkout MOZ_CO_PROJECT=all MOZ_CO_DATE="' . $pullDate . '"',
'dir' => $releaseTagDir . '/cvsroot/mozilla',
'timeout' => '3600',
'logFile' => $logDir . '/mozilla-checkout.log',
);
# Create the RELEASE tag
$this->_CvsTag(
'tagName' => $releaseTag,
'coDir' => $releaseTagDir . '/cvsroot/mozilla',
'timeout' => '3600',
'logFile' => $logDir . '/cvsroot_tag-' . $releaseTag . '.log',
);
# Create the RC tag
$this->_CvsTag(
'tagName' => $rcTag,
'coDir' => $releaseTagDir . '/cvsroot/mozilla',
'timeout' => '3600',
'logFile' => $logDir . '/cvsroot_tag-' . $rcTag . '.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' => 'client.mk',
'coDir' => $releaseTagDir . '/cvsroot/mozilla',
'logFile' => $logDir . '/cvsroot_tag-' . $minibranchTag. '.log',
);
# Update client.mk to the minibranch you just created.
$this->Shell(
'cmd' => 'cvs up -r ' . $minibranchTag . ' client.mk',
'dir' => $releaseTagDir . '/cvsroot/mozilla',
'logFile' => $logDir . '/client_mk-update.log',
);
# Add the new product tag to the client.mk
open(INFILE, "<$releaseTagDir/cvsroot/mozilla/client.mk");
open(OUTFILE, ">$releaseTagDir/cvsroot/mozilla/client.mk.tmp");
while(<INFILE>) {
$_ =~ s/$branchTag/$releaseTag/g;
print OUTFILE $_;
}
close INFILE;
close OUTFILE;
if (not File::Copy::move("$releaseTagDir/cvsroot/mozilla/client.mk.tmp",
"$releaseTagDir/cvsroot/mozilla/client.mk")) {
die "Cannot rename $releaseTagDir/cvsroot/mozilla/client.mk.tmp to $releaseTagDir/cvsroot/mozilla/client.mk";
}
$this->Shell(
'cmd' => 'cvs commit -m "For ' . $product . ' ' . $version . ', redirect client.mk onto the ' . $releaseTag . ' tag." client.mk',
'dir' => $releaseTagDir . '/cvsroot/mozilla',
'logFile' => $logDir . '/client_mk-release_tag.log',
);
$this->CheckLog(
'log' => $logDir . '/client_mk-release_tag.log',
'checkFor' => '^Checking in client.mk;',
);
$this->CheckLog(
'log' => $logDir . '/client_mk-release_tag.log',
'checkFor' => '^done',
);
# Move the release tag onto the modified version of the pull scripts.
$this->_CvsTag(
'tagName' => $releaseTag,
'force' => '1',
'files' => 'client.mk',
'coDir' => $releaseTagDir . '/cvsroot/mozilla',
'logFile' => $logDir . '/cvsroot_clientmk_tag-' . $releaseTag. '.log',
);
# Move the RC tag onto the modified version of the pull scripts.
$this->_CvsTag(
'tagName' => $rcTag,
'force' => '1',
'files' => 'client.mk',
'coDir' => $releaseTagDir . '/cvsroot/mozilla',
'logFile' => $logDir . '/cvsroot_clientmk_tag-' . $rcTag. '.log',
);
# Create the mofo tag directory.
if (not -d "$releaseTagDir/mofo") {
MkdirWithPath('dir' => "$releaseTagDir/mofo")
or die "Cannot mkdir $releaseTagDir/mofo: $!";
}
# Check out the talkback files from the branch you want to tag.
$this->Shell(
'cmd' => 'cvs -d ' . $mofoCvsroot . ' co -r ' . $branchTag . ' -D "' . $pullDate . '" talkback/fullsoft',
'dir' => $releaseTagDir . '/mofo',
'logFile' => $logDir . '/mofo-checkout.log'
);
# Create the talkback RELEASE tag.
$this->_CvsTag(
'tagName' => $releaseTag,
'coDir' => $releaseTagDir . '/mofo/talkback/fullsoft',
'logFile' => $logDir . '/mofo_tag-' . $releaseTag. '.log',
);
# Create the l10n tag directory.
if (not -d "$releaseTagDir/l10n") {
MkdirWithPath('dir' => "$releaseTagDir/l10n")
or die "Cannot mkdir $releaseTagDir/l10n: $!";
}
# Grab list of shipped locales
my $shippedLocales =
$releaseTagDir . '/cvsroot/mozilla/' . $appName . '/locales/shipped-locales';
open (FILE, "< $shippedLocales")
or die "Cannot open file $shippedLocales: $!";
my @locales = <FILE>;
close FILE or die "Cannot close file $shippedLocales: $!";
# Check out the l10n files from the branch you want to tag.
for my $locale (@locales) {
# only keep first column
$locale =~ s/(\s+).*//;
# skip en-US, this is the default locale
if ($locale eq 'en-US') {
next;
}
$this->Shell(
'cmd' => 'cvs -d ' . $l10nCvsroot . ' co -r ' . $branchTag . ' -D "' . $pullDate . '" l10n/' . $locale,
'dir' => $releaseTagDir . '/l10n',
'logFile' => $logDir . '/l10n-checkout.log',
);
}
# Create the l10n RELEASE tag.
$this->_CvsTag(
'tagName' => $releaseTag,
'coDir' => $releaseTagDir . '/l10n/l10n',
'logFile' => $logDir . '/l10n_tag-' . $releaseTag. '.log',
);
# Create the RC tag.
$this->_CvsTag(
'tagName' => $rcTag,
'coDir' => $releaseTagDir . '/l10n/l10n',
'logFile' => $logDir . '/l10n_tag-' . $rcTag. '.log',
);
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify tag');
# XXX temp disable
#$this->Shell('cmd' => 'echo Verify tag');
}
sub _CvsTag {
my $this = shift;
my %args = @_;
my $tagName = $args{'tagName'};
my $coDir = $args{'coDir'};
my $branch = $args{'branch'};
my $files = $args{'files'};
my $force = $args{'force'};
my $logFile = $args{'logFile'};
my $logDir = $this->Config('var' => 'logDir');
my $cmd;
my $cvsCommand = 'cvs tag';
my $checkForOnly = '^T ';
# only force or branch specific files, not the whole tree
if ($branch and $files) {
$cmd = $cvsCommand . ' -b ' . $tagName . ' ' . $files;
$checkForOnly = '^B ';
} elsif ($force and $files) {
$cmd = $cvsCommand . ' -F ' . $tagName . ' ' . $files;
} else {
die("Must specify files if branch or force option is used.");
}
# regular tags can be applied to specific files or the whole tree
# if no files are specified.
if ($files) {
$cmd = $cvsCommand . ' ' . $tagName . $files;
} else {
$cmd = $cvsCommand . ' ' . $tagName;
}
$this->Shell(
'cmd' => $cmd,
'dir' => $coDir,
'timeout' => 3600,
'logFile' => $logFile,
);
# $this->CheckLog(
# 'log' => $logFile,
# 'checkForOnly' => $checkForOnly,
# );
}
1;

View File

@ -1,15 +1,135 @@
#
# Updates step. Generates binary update (MAR) files as well as AUS config
# snippets.
#
package Bootstrap::Step::Updates;
use Bootstrap::Step;
use File::Find;
use MozBuild::Util;
@ISA = ("Bootstrap::Step");
sub Execute {
my $this = shift;
$this->Shell('cmd' => 'echo updates');
my $product = $this->Config('var' => 'product');
my $logDir = $this->Config('var' => 'logDir');
my $version = $this->Config('var' => 'version');
my $mozillaCvsroot = $this->Config('var' => 'mozillaCvsroot');
my $mofoCvsroot = $this->Config('var' => 'mofoCvsroot');
my $updateDir = $this->Config('var' => 'updateDir');
my $patcherConfig = $this->Config('var' => 'patcherConfig');
# Create updates area.
if (not -d $updateDir) {
MkdirWithPath('dir' => $updateDir) or die "Cannot mkdir $updateDir: $!";
}
$this->Shell(
'cmd' => 'cvs -d ' . $mozillaCvsroot . ' co -d patcher mozilla/tools/patcher',
'logFile' => $logDir . '/patcher_checkout.log',
'dir' => $updateDir,
'timeout' => 3600,
);
# config lives in private repo
$this->Shell(
'cmd' => 'cvs -d ' . $mofoCvsroot . ' co -d config release/patcher/' . $patcherConfig,
'logFile' => $logDir . '/patcher_config-checkout.log',
'dir' => $updateDir,
);
# build tools
my $originalCvsrootEnv = $ENV{'CVSROOT'};
$ENV{'CVSROOT'} = $mozillaCvsroot;
$this->Shell(
'cmd' => './patcher2.pl --build-tools --app=' . $product . ' --config=../config/moz180-branch-patcher2.cfg',
'logFile' => $logDir . '/patcher_build-tools.log',
'dir' => $updateDir . '/patcher',
'timeout' => 3600,
);
if ($originalCvsrootEnv) {
$ENV{'CVSROOT'} = $originalCvsrootEnv;
}
# download complete MARs
$this->Shell(
'cmd' => './patcher2.pl --download --app=' . $product . ' --config=../config/moz180-branch-patcher2.cfg',
'logFile' => $logDir . '/patcher_download.log',
'dir' => $updateDir . '/patcher',
'timeout' => 3600,
);
# Create partial patches and snippets
$this->Shell(
'cmd' => './patcher2.pl --create-patches -app=' . $product . ' --config=../config/moz180-branch-patcher2.cfg',
'logFile' => $logDir . '/patcher_create-patches.log',
'dir' => $updateDir . '/patcher',
'timeout' => 18000,
);
# prepare aus2-staging
# ssh aus2-staging.mozilla.org
# cd /opt/aus2/incoming/3-staging
# tmpdir="`date +%Y%m%d`-${SHORT_PRODUCT}-${VERSION}"
# sudo mkdir ${tmpdir}-test
# sudo chown cltbld ${tmpdir}-test
# sudo mkdir ${tmpdir}
# sudo chown cltbld ${tmpdir}
# # copy updates from prometheus-vm.mozilla.org
# ssh prometheus-vm.mozilla.org
# cd /builds/${VERSION}-updates/release/patcher/temp/firefox/${PREVIOUS_VERSION}-${VERSION}/
# rsync -nav -e "ssh -i $HOME/.ssh/aus" aus2.test/ aus2-staging.mozilla.org:/opt/aus2/incoming/3-staging/${tmpdir}-test/
# rsync -nav -e "ssh -i $HOME/.ssh/aus" aus2/ aus2-staging.mozilla.org:/opt/aus2/incoming/3-staging/${tmpdir}/
}
sub Verify {
my $this = shift;
$this->Shell('cmd' => 'echo Verify updates');
my $logDir = $this->Config('var' => 'logDir');
my $version = $this->Config('var' => 'version');
my $oldVersion = $this->Config('var' => 'oldVersion');
my $mozillaCvsroot = $this->Config('var' => 'mozillaCvsroot');
my $updateDir = $this->Config('var' => 'updateDir');
my $verifyDir = $this->Config('var' => 'verifyDir');
### quick verification
# ensure that there are only test channels
my $testDir = $verifyDir . '/' . $version . '-updates/patcher/temp/' . $product . $oldVersion . '-' . $version . '/aus2.test';
File::Find::find(\&TestAusCallback, $testDir);
# Create verification area.
my $verifyDirVersion = $verifyDir . $version;
MkdirWithPath('dir' => $verifyDirVersion)
or die("Could not mkdir $verifyDirVersion: $!");
$this->Shell(
'cmd' => 'cvs -d ' . $mozillaCvsroot . ' co -d updates mozilla/testing/release/updates/',
'logFile' => $logDir . '/verify-updates_checkout.log',
'dir' => $verifyDirVersion,
);
$this->Shell(
'cmd' => 'cvs -d ' . $mozillaCvsroot . ' co -d common mozilla/testing/release/common/',
'logFile' => $logDir . '/verify-updates_checkout.log',
'dir' => $verifyDirVersion,
);
# Customize updates.cfg to contain the channels you are interested in
# testing.
$this->Shell(
'cmd' => './verify.sh -t',
'logFile' => $logDir . '/verify_updates.log',
'dir' => $verifyDirVersion . '/updates',
'timeout' => 3600,
);
}
sub TestAusCallback {
my $dir = $File::Find::name;
if ($dir =~ /test/) {
die("Non-test directory found in $testDir/aus2.test: $dir");
}
}
1;