From 70cfb2c36e938ac6afe6f7bd40ea480880ad68f1 Mon Sep 17 00:00:00 2001 From: "nrthomas%gmail.com" Date: Fri, 28 Sep 2007 07:32:55 +0000 Subject: [PATCH] Bug 397541, publish nightly builds to nightly/YYYY/MM/ and symlink back to nightly, r=preed --- tools/tinderbox/post-mozilla-rel.pl | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tools/tinderbox/post-mozilla-rel.pl b/tools/tinderbox/post-mozilla-rel.pl index afe68ac2c77..d05080fba5c 100755 --- a/tools/tinderbox/post-mozilla-rel.pl +++ b/tools/tinderbox/post-mozilla-rel.pl @@ -1029,12 +1029,16 @@ sub pushit { $ssh_opts = "-".$Settings::ssh_version; $scp_opts = "-oProtocol=".$Settings::ssh_version; } + if (defined($Settings::ssh_key) && $Settings::ssh_key ne '') { + $ssh_opts .= " -i ".$Settings::ssh_key; + $scp_opts .= " -i ".$Settings::ssh_key; + } # The ReleaseToDated and ReleaseToLatest configuration settings give us the # ability to fine-tune where release files are stored. ReleaseToDated # will store the release files in a directory of the form # - # nightly/YYYY-MM-DD-HH- + # nightly/YYYY/MM/YYYY-MM-DD-HH- # # while ReleaseToLatest stores the release files in a directory of the form # @@ -1045,29 +1049,41 @@ sub pushit { # variables defined yet, we want to set them to default values here. # Hopefully, though, we'll have also updated tinder-defaults.pl if we've # updated post-mozilla-rel.pl from CVS. + # + # Note that we traverse this code for "hourlies" as well as nightlies/clobbers + # $package_name, and hence $short_ud, will be (eg) "fx-linux-tbox-trunk" and + # "2007-09-27-04-trunk" respectively. $Settings::ReleaseToDated = 1 if !defined($Settings::ReleaseToDated); $Settings::ReleaseToLatest = 1 if !defined($Settings::ReleaseToLatest); if ( $Settings::ReleaseToDated ) { - my $makedirs = "$remote_path/$short_ud"; + my $datedir = ''; + if( $cachebuild && ($short_ud =~ /^(\d{4})-(\d{2}).*/) ) { + $datedir = "$1/$2/"; + } + my $complete_remote_path = "$remote_path/" . $datedir . "$short_ud"; + my $makedirs = $complete_remote_path; if ($cachebuild && $Settings::ReleaseToLatest) { $makedirs .= " $remote_path/latest-$Settings::milestone"; } push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server mkdir -p $makedirs"); # this is a workaround for pacifica-vm, which doesn't support the /. notation for scp (bug 383775) if ($^O eq "cygwin") { - push(@cmds,"rsync -av -e \"ssh $ssh_opts\" $upload_directory/ $Settings::ssh_user\@$ssh_server:$remote_path/$short_ud/"); + push(@cmds,"rsync -av -e \"ssh $ssh_opts\" $upload_directory/ $Settings::ssh_user\@$ssh_server:$complete_remote_path/"); } else { - push(@cmds,"scp -r -p $scp_opts $upload_directory/. $Settings::ssh_user\@$ssh_server:$remote_path/$short_ud/"); + push(@cmds,"scp -r -p $scp_opts $upload_directory/. $Settings::ssh_user\@$ssh_server:$complete_remote_path/"); } - push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server chmod -R 775 $remote_path/$short_ud"); + push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server chmod -R 775 $complete_remote_path"); if ($Settings::ReleaseGroup ne '') { - push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server chgrp -R $Settings::ReleaseGroup $remote_path/$short_ud"); + push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server chgrp -R $Settings::ReleaseGroup $complete_remote_path"); + } + if ( $cachebuild ) { + push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server 'cd $remote_path && ln -s $datedir/$short_ud/ .'"); } if ( $cachebuild and $Settings::ReleaseToLatest ) { - push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server rsync -avz $remote_path/$short_ud/ $remote_path/latest-$Settings::milestone/"); + push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server rsync -avz $complete_remote_path/ $remote_path/latest-$Settings::milestone/"); } } elsif ( $Settings::ReleaseToLatest ) { push(@cmds,"ssh $ssh_opts -l $Settings::ssh_user $ssh_server mkdir -p $remote_path/latest-$Settings::milestone");