automate tinderbox configuration b=371325 r=preed
authorrhelmer@mozilla.com
Tue, 24 Apr 2007 15:04:12 -0700
changeset 770 d4e036ef68708e9fc197a4f7b6de59d77a186fd2
parent 769 781e7d730cad4c82e08e42ec2ef56bbffe5ea2e5
child 771 2eec5986c49e45fd7657976c19e8c81228df97b3
push idunknown
push userunknown
push dateunknown
reviewerspreed
bugs371325
milestone1.9a4pre
automate tinderbox configuration b=371325 r=preed
tools/release/Bootstrap/Step/TinderConfig.pm
tools/release/Makefile
tools/release/bootstrap.cfg.example
tools/release/release
new file mode 100644
--- /dev/null
+++ b/tools/release/Bootstrap/Step/TinderConfig.pm
@@ -0,0 +1,95 @@
+##
+# TinderConfig - creates config file for Tinderbox
+##
+
+package Bootstrap::Step::TinderConfig;
+
+use Bootstrap::Step;
+use Bootstrap::Config;
+use MozBuild::TinderLogParse;
+use MozBuild::Util qw(MkdirWithPath);
+
+@ISA = ("Bootstrap::Step");
+
+sub Execute {
+    my $this = shift;
+
+    my $config = new Bootstrap::Config();
+    my $configBumpDir = $config->Get(var => 'configBumpDir');
+    my $productTag = $config->Get(var => 'productTag');
+    my $version = $config->Get(var => 'version');
+    my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
+    my $product = $config->Get(var => 'product');
+    my $logDir = $config->Get(var => 'logDir');
+    my $branchTag = $config->Get(var => 'branchTag');
+    my $osname = $config->SystemInfo(var => 'osname');
+
+    my $releaseTag = $productTag . '_RELEASE';
+
+    MkdirWithPath(dir => $configBumpDir)
+      or die("Cannot mkdir $configBumpDir: $!");
+
+    foreach my $branch ($branchTag . '_release', $branchTag . '_l10n_release') {
+        $this->Shell(
+          cmd => 'cvs',
+          cmdArgs => ['-d', $mozillaCvsroot, 
+                      'co', '-d', 'tinderbox-configs',
+                      '-r', $branch,
+                      'mozilla/tools/tinderbox-configs/' . 
+                      $product . '/' . $osname],
+          logFile => catfile($logDir, 
+           'build_config-checkout-' . $branch . '.log'),
+          dir => $configBumpDir,
+        );
+    
+        foreach my $configFile ('tinder-config.pl', 'mozconfig') {
+            $config->Bump( configFile => 
+             catfile($configBumpDir, 'tinderbox-configs', $configFile));
+            $this->Shell(
+              cmd => 'cvs',
+              cmdArgs => ['-d', $mozillaCvsroot, 
+                          'ci', '-m', 
+                          '"Automated configuration bump, release for ' 
+                           . $product  . ' ' . $version . '"', 
+                          'tinderbox-configs/' . $configFile],
+              logFile => catfile($logDir, 
+               'build_config-checkin-' . $configFile . '-' . 
+                $branch . '.log'),
+              dir => catfile($configBumpDir),
+            );
+        }
+    }
+}
+
+sub Verify {
+    my $this = shift;
+
+    my $config = new Bootstrap::Config();
+    my $branchTag = $config->Get(var => 'branchTag');
+    my $logDir = $config->Get(var => 'logDir');
+
+    foreach my $branch ($branchTag . '_release', $branchTag . '_l10n_release') {
+        $this->CheckLog(
+            log => catfile($logDir, 
+             'build_config-checkout-' . $branch . '.log'),
+            notAllowed => 'fail',
+        );
+        $this->CheckLog(
+            log => catfile($logDir, 
+             'build_config-checkout-' . $branch . '.log'),
+            notAllowed => 'aborted',
+        );
+        foreach my $configFile ('mozconfig', 'tinder-config.pl') {
+            $this->CheckLog(
+             log => catfile($logDir,
+               'build_config-checkin-' . $configFile . '-' .  $branch . '.log'),
+             notAllowed => 'fail',
+            );
+            $this->CheckLog(
+             log => catfile($logDir,
+               'build_config-checkin-' . $configFile . '-' .  $branch . '.log'),
+             notAllowed => 'aborted',
+            );
+        }
+    }
+}
--- a/tools/release/Makefile
+++ b/tools/release/Makefile
@@ -1,39 +1,40 @@
 test:
 	for f in release t/test.pl `find . -name "*.pm"`; do perl -c $$f; done
 	if [ -f t/test.log ]; then rm t/test.log; fi
 	if [ ! -f bootstrap.cfg ]; then cp bootstrap.cfg.example bootstrap.cfg; fi
 	./t/test.pl
 
 stage:
 	# basic environment
+	mkdir -p /builds/config
 	mkdir -p /builds/tags
 	mkdir -p /builds/updates/
 	mkdir -p /builds/verify/
 	# ftp
 	mkdir -p /home/ftp/pub/firefox/nightly
 	# fake key
 	mkdir -p /home/ftp/pub/firefox/releases/1.5/
 	touch /home/ftp/pub/firefox/releases/1.5/KEY
 	# staging environment
-	mkdir -p /data/cltbld/firefox-1.5.0.11/batch1/stage
+	mkdir -p /data/cltbld/firefox-2.0.0.4/batch1/stage
 
 cvsmirror: cvsmirror_mofo cvsmirror_main
 
 cvsmirror_main:
 	rsync -a --delete-after --exclude=CVSROOT/config --exclude=CVSROOT/loginfo cvs-mirror.mozilla.org::mozilla/ /builds/cvsmirror/cvsroot/
 	rsync -a --delete-after cvs-mirror.mozilla.org::l10n/ /builds/cvsmirror/l10n/
 	chgrp -R cvs /builds/cvsmirror/cvsroot /builds/cvsmirror/l10n
 	chmod -R g+rw /builds/cvsmirror/cvsroot /builds/cvsmirror/l10n
-	cvs -d /builds/cvsmirror/cvsroot rtag -d FIREFOX_1_5_0_11_RELEASE mozilla
-	cvs -d /builds/cvsmirror/cvsroot rtag -d FIREFOX_1_5_0_11_RC1 mozilla
-	cvs -d /builds/cvsmirror/cvsroot rtag -d -B FIREFOX_1_5_0_11_MINIBRANCH mozilla
-	cvs -d /builds/cvsmirror/l10n rtag -d FIREFOX_1_5_0_11_RELEASE l10n
-	cvs -d /builds/cvsmirror/l10n rtag -d FIREFOX_1_5_0_11_RC1 l10n
+	cvs -d /builds/cvsmirror/cvsroot rtag -d FIREFOX_2_0_0_4_RELEASE mozilla
+	cvs -d /builds/cvsmirror/cvsroot rtag -d FIREFOX_2_0_0_4_RC1 mozilla
+	cvs -d /builds/cvsmirror/cvsroot rtag -d -B FIREFOX_2_0_0_4_MINIBRANCH mozilla
+	cvs -d /builds/cvsmirror/l10n rtag -d FIREFOX_2_0_0_4_RELEASE l10n
+	cvs -d /builds/cvsmirror/l10n rtag -d FIREFOX_2_0_0_4_RC1 l10n
 
 cvsmirror_mofo:
 	mkdir -p /builds/cvsmirror/tmp/mofo
 	mkdir -p /builds/cvsmirror/mofo
 	cvs -d /builds/cvsmirror/mofo init
 	cd /builds/cvsmirror/tmp/mofo && cvs -d cltbld@cvs.mozilla.org:/mofo export -r MOZILLA_1_8_0_BRANCH talkback
 	cd /builds/cvsmirror/tmp/mofo && cvs -d cltbld@cvs.mozilla.org:/mofo export -r HEAD release
 	rm -rf /builds/cvsmirror/tmp/mofo/release/tinderbox-configs/
@@ -41,16 +42,17 @@ cvsmirror_mofo:
 	cd /builds/cvsmirror/tmp/mofo/release && cvs -d /builds/cvsmirror/mofo import -d -m "import CVS snapshot" release MOZILLA_1_8_0_BRANCH_release R0_1
 	cd /builds/cvsmirror/tmp/mofo/talkback && cvs -d /builds/cvsmirror/mofo import -d -m "import CVS snapshot" talkback MOZILLA_1_8_0_BRANCH R0_1
 	rm -rf /builds/cvsmirror/tmp/mofo
 	chgrp -R cvs /builds/cvsmirror/mofo
 	chmod g+rwx /builds/cvsmirror/mofo
 	chmod -R g+rw /builds/cvsmirror/mofo
 
 clean_stage:
+	rm -rf /builds/config/*
 	rm -rf /builds/tags/*
 	rm -rf /builds/release/logs/*
 	rm -rf /builds/updates/*
 	rm -rf /builds/verify/*
 	rm -rf /data/cltbld/firefox-*/
 	rm -rf /home/ftp/pub/firefox/*
 
 clean_cvsmirror: clean_cvsmirror_main clean_cvsmirror_mofo
--- a/tools/release/bootstrap.cfg.example
+++ b/tools/release/bootstrap.cfg.example
@@ -1,40 +1,55 @@
-productTag      = FIREFOX_1_5_0_11
-branchTag       = MOZILLA_1_8_0_BRANCH
-pullDate        = 2007-03-10 00:00 PST
-l10n_pullDate   = 2007-03-10 00:00 PST
-version         = 1.5.0.11
+version         = 2.0.0.4
+milestone       = 1.8.1.4
+# _RCn and _RELEASE will be appended as-needed
+productTag      = FIREFOX_2_0_0_4
+# Branch name and pull dates to use for base tag
+branchTag       = MOZILLA_1_8_BRANCH
+pullDate        = 2007-04-17 00:00:00 PDT
+l10n_pullDate   = 2007-04-17 00:00:00 PDT
 rc              = 1
-oldVersion      = 1.5.0.10
+# oldVersion and oldRc refer to the previous release
+oldVersion      = 2.0.0.3
 oldRc           = 1
-milestone       = 1.8.0.11
 appName         = browser
 product         = firefox
-linux_buildDir  = /builds/tinderbox/Fx-Mozilla1.8.0-Release
-mac_buildDir    = /builds/tinderbox/Fx-Mozilla1.8.0-Release
-win32_buildDir  = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8.0-Release
-linux_l10n_buildDir  = /builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
-mac_l10n_buildDir    = /builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
-win32_l10n_buildDir  = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8.0-l10n-Release
-logDir          = /home/rhelmer/src/full/build/logs
+# Absolute path to tinderbox build directory
+linux_buildDir  = /builds/tinderbox/Fx-Mozilla1.8-Release
+mac_buildDir    = /builds/tinderbox/Fx-Mozilla1.8-Release
+win32_buildDir  = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-Release
+linux_l10n_buildDir  = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
+mac_l10n_buildDir    = /builds/tinderbox/Fx-Mozilla1.8-l10n-Release
+win32_l10n_buildDir  = /cygdrive/c/builds/tinderbox/Fx-Mozilla1.8-l10n-Release
+# Absolute path to store bootstrap's logs
+logDir          = /home/buildslave/console1/AutomationTest/build/logs
 mozillaCvsroot  = /builds/cvsmirror/cvsroot
 l10nCvsroot     = /builds/cvsmirror/l10n
 mofoCvsroot     = /builds/cvsmirror/mofo
+# private staging area 
 stageHome       = /data/cltbld
 updateDir       = /builds/updates
 verifyDir       = /builds/verify
-patcherConfig   = moz180-branch-patcher2.cfg
 tagDir          = /builds/tags
-linux_buildPlatform   = Linux_2.4.21-37.EL_Depend
+configBumpDir   = /builds/config
+# Build platform, as specified by tinderbox
+linux_buildPlatform   = Linux_2.6.9-42.ELsmp_Depend
 macosx_buildPlatform  = Darwin_8.7.0_Depend
 win32_buildPlatform   = WINNT_5.2_Depend
-linux_l10n_buildPlatform   = Linux_2.4.21-37.EL_Depend
+linux_l10n_buildPlatform   = Linux_2.6.9-42.ELsmp_Depend
 macosx_l10n_buildPlatform  = Darwin_8.7.0_Depend
 win32_l10n_buildPlatform   = WINNT_5.2_Depend
 from            = bootstrap@example.com
-to              = engineer@example.com
-cc              = qa@example.com, build@example.com
-patcherConfig   = moz180-branch-patcher2.cfg
+to              = test@example.com
+cc              = other@example.com
+patcherConfig   = moz18-branch-patcher2.cfg
+# Tag to use for building MAR/MBSDIFF and other update tools
 patcherToolsRev = MOZILLA_1_9a2_RELEASE
-verifyConfig    = moz180-firefox-linux.cfg
+verifyConfig    = moz18-firefox-linux.cfg
 blat            = /cygdrive/d/moztools/bin/blat.exe
 sendmail        = /usr/lib/sendmail
+# dump Log output to stdout
+dumpLogs        = 1
+# username and server to push builds
+sshUser         = buildslave
+sshServer       = localhost
+# Tinderbox server tree that clients should report to
+buildTree       = MozillaTest
--- a/tools/release/release
+++ b/tools/release/release
@@ -1,23 +1,25 @@
 #!/usr/bin/perl -w
 use strict;
 
 use Getopt::Long;
 use MozBuild::Util qw(Email);
 use Bootstrap::Step::Tag;
+use Bootstrap::Step::TinderConfig;
 use Bootstrap::Step::Build;
 use Bootstrap::Step::Source;
 use Bootstrap::Step::Repack;
 use Bootstrap::Step::Updates;
 use Bootstrap::Step::Stage;
 use Bootstrap::Step::Sign;
 
 my @allSteps = (
     'Tag',
+    'TinderConfig',
     'Build',
     'Source',
     'Repack',
     'Updates',
     'Stage',
     'Sign',
 );
 
@@ -143,17 +145,17 @@ sub PerformStep {
         eval {
             Email(
               blat => $blat,
               sendmail => $sendmail,
               from => $from,
               to => $to,
               cc => \@ccList,
               subject => "$hostname - Step $stepName died: $error",
-              message => "$hostname - Step $stepName died: $error\nSee the release.log for more information.",
+              message => "$hostname - Step $stepName died: $error",
             );
             exit(1);
         };
         if ($@) {
             print "Unable to email failure message to $to: $@";
             exit(1);
         }
     }