sync private area with stage, change name of method to SyncToStaging() p=joduinn r=rhelmer b=396438

This commit is contained in:
rhelmer@mozilla.com 2007-10-16 18:56:37 -07:00
parent 0afe65ff74
commit c442cd5dd9
6 changed files with 40 additions and 18 deletions

View File

@ -6,7 +6,7 @@ package Bootstrap::Step::Build;
use File::Temp qw(tempfile);
use Bootstrap::Step;
use Bootstrap::Util qw(CvsCatfile SyncNightlyDirToStaging);
use Bootstrap::Util qw(CvsCatfile SyncToStaging);
@ISA = ("Bootstrap::Step");
@ -156,7 +156,7 @@ sub Push {
logFile => $pushLog,
);
SyncNightlyDirToStaging();
SyncToStaging();
}
sub Announce {

View File

@ -5,7 +5,7 @@
package Bootstrap::Step::Repack;
use Bootstrap::Step;
use Bootstrap::Config;
use Bootstrap::Util qw(CvsCatfile SyncNightlyDirToStaging);
use Bootstrap::Util qw(CvsCatfile SyncToStaging);
use MozBuild::Util qw(MkdirWithPath);
@ISA = ("Bootstrap::Step");
@ -233,7 +233,7 @@ sub Push {
logFile => $pushLog,
);
SyncNightlyDirToStaging();
SyncToStaging();
}
sub Announce {

View File

@ -4,7 +4,7 @@
package Bootstrap::Step::Sign;
use Bootstrap::Step;
use Bootstrap::Config;
use Bootstrap::Util qw(SyncNightlyDirToStaging);
use Bootstrap::Util qw(SyncToStaging);
@ISA = ("Bootstrap::Step");
sub Execute {
@ -36,7 +36,7 @@ sub Announce {
}
sub Push {
SyncNightlyDirToStaging();
SyncToStaging();
}
1;

View File

@ -8,7 +8,7 @@ use Bootstrap::Config;
use File::Copy qw(move);
use File::Find qw(find);
use MozBuild::Util qw(MkdirWithPath);
use Bootstrap::Util qw(SyncNightlyDirToStaging);
use Bootstrap::Util qw(SyncToStaging);
@ISA = ("Bootstrap::Step");
sub Execute {
@ -116,7 +116,7 @@ sub Push {
dir => catfile($stageDir),
);
SyncNightlyDirToStaging();
SyncToStaging();
}
sub Announce {

View File

@ -6,7 +6,7 @@ package Bootstrap::Step::Updates;
use Bootstrap::Step;
use Bootstrap::Config;
use Bootstrap::Util qw(CvsCatfile SyncNightlyDirToStaging GetLocaleManifest);
use Bootstrap::Util qw(CvsCatfile SyncToStaging GetLocaleManifest);
use File::Find qw(find);
use POSIX qw(strftime);
@ -396,7 +396,7 @@ sub Push {
);
}
SyncNightlyDirToStaging();
SyncToStaging();
# Push test channels live
$this->Shell(

View File

@ -15,7 +15,7 @@ our @EXPORT_OK = qw(CvsCatfile CvsTag
GetLocaleManifest
GetBouncerPlatforms GetPatcherPlatforms
GetBouncerToPatcherPlatformMap
SyncNightlyDirToStaging);
SyncToStaging);
our($DEFAULT_SHELL_TIMEOUT);
@ -286,11 +286,14 @@ sub GetDiffFileList {
return \@differentFiles;
}
sub SyncNightlyDirToStaging {
sub SyncToStaging {
my $config = new Bootstrap::Config();
my $version = $config->Get(var => 'version');
my $product = $config->Get(var => 'product');
my $productTag = $config->Get(var => 'productTag');
my $rc = $config->Get(var => 'rc');
my $logDir = $config->Get(sysvar => 'logDir');
my $stageHome = $config->Get(var => 'stageHome');
my $stagingUser = $config->Get(var => 'stagingUser');
my $stagingServer = $config->Get(var => 'stagingServer');
my $externalStagingUser = $config->Get(var => 'externalStagingUser');
@ -298,24 +301,43 @@ sub SyncNightlyDirToStaging {
my $rcTag = $productTag . '_RC' . $rc;
my $pushLog = catfile($logDir, 'build_' . $rcTag . '-push.log');
my $nightlyDir = $config->GetFtpNightlyDir();
my $dirName = $config->GetFtpNightlyDir();
my $command = 'ssh';
my @cmdArgs = ($stagingUser . '@' . $stagingServer,
'rsync', '-av', $nightlyDir,
'rsync', '-av', $dirName,
$externalStagingUser.'@'.$externalStagingServer.':'.
$nightlyDir);
print 'Bootstrap::Util::SyncNightlyDirToStaging() Running shell command: '.$command.' '.join(' ', @cmdArgs)."\n";
$dirName);
print 'Bootstrap::Util::SyncToStaging() Running shell command: '.$command.' '.join(' ', @cmdArgs)."\n";
my $rv = RunShellCommand(command => $command,
args => \@cmdArgs,
redirectStderr => 1,
logfile => $pushLog);
print 'Bootstrap::Util::SyncNightlyDirToStaging() Output: ' .
print 'Bootstrap::Util::SyncToStaging() Output: ' .
$rv->{'output'} . "\n";
if ($rv->{'exitValue'} != 0) {
die "ASSERT: SyncNightlyDirToStaging(): rsync failed\n";
die "ASSERT: SyncToStaging(): rsync failed\n";
}
$dirName = CvsCatfile($stageHome, $product.'-'.$version);
@cmdArgs = ($stagingUser . '@' . $stagingServer,
'rsync', '-av', $dirName,
$externalStagingUser.'@'.$externalStagingServer.':'.
$dirName);
print 'Bootstrap::Util::SyncToStaging() Running shell command: '.$command.' '.join(' ', @cmdArgs)."\n";
$rv = RunShellCommand(command => $command,
args => \@cmdArgs,
redirectStderr => 1,
logfile => $pushLog);
print 'Bootstrap::Util::SyncToStaging() Output: ' .
$rv->{'output'} . "\n";
if ($rv->{'exitValue'} != 0) {
die "ASSERT: SyncToStaging(): rsync failed\n";
}
}