Update the rest of the buildbot scripts for AMBuild.
Former-commit-id: ef3e192105c8c7f3905a2ceb82df4751d51cc013
This commit is contained in:
parent
426771deda
commit
e56cd58d70
@ -10,7 +10,7 @@ chdir($path);
|
||||
require 'helpers.pm';
|
||||
|
||||
#Go to main source dir
|
||||
chdir(Build::PathFormat('../..'));
|
||||
chdir(Build::PathFormat('../../..'));
|
||||
|
||||
#Get the source path.
|
||||
our ($root) = getcwd();
|
||||
|
@ -9,6 +9,24 @@ our $SVN = "/usr/bin/svn";
|
||||
our $SVN_USER = 'dvander';
|
||||
our $SVN_ARGS = '';
|
||||
|
||||
sub GitRevNum
|
||||
{
|
||||
my ($path) = (@_);
|
||||
my ($cd, $text, $rev);
|
||||
|
||||
$cd = Cwd::cwd();
|
||||
chdir($path);
|
||||
$text = `git rev-list --count HEAD`;
|
||||
chdir($cd);
|
||||
|
||||
chomp $text;
|
||||
if ($text =~ /^(\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub HgRevNum
|
||||
{
|
||||
my ($path) = (@_);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
# vim: set ts=4 sts=4 sw=4 tw=99 noet:
|
||||
|
||||
use strict;
|
||||
use Cwd;
|
||||
@ -28,7 +29,7 @@ require 'helpers.pm';
|
||||
|
||||
my ($version);
|
||||
$version = Build::ProductVersion(Build::PathFormat('../../product.version'));
|
||||
$version .= '-hg' . Build::HgRevNum('.');
|
||||
$version .= '-git' . Build::GitRevNum('.');
|
||||
|
||||
#Switch to the output folder.
|
||||
chdir(Build::PathFormat('../../../OUTPUT'));
|
||||
@ -38,9 +39,33 @@ my (@packages,@mac_exclude);
|
||||
@mac_exclude = ('esf', 'ns', 'ts');
|
||||
|
||||
my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/);
|
||||
$ftp_path .= "/$major.$minor";
|
||||
|
||||
my ($i);
|
||||
for ($i = 0; $i <= $#packages; $i++) {
|
||||
my ($filename);
|
||||
next if (($^O eq "darwin") && ($packages[$i] ~~ @mac_exclude));
|
||||
|
||||
if ($^O eq "linux") {
|
||||
$filename = "amxmodx-$version-" . $packages[$i] . "-linux.tar.gz";
|
||||
} elsif ($^O eq "darwin") {
|
||||
$filename = "amxmodx-$version-" . $packages[$i] . "-mac.zip";
|
||||
} else {
|
||||
$filename = "amxmodx-$version-" . $packages[$i] . "-windows.zip";
|
||||
}
|
||||
unlink($filename);
|
||||
|
||||
chdir(Build::PathFormat("packages/" . $packages[$i]));
|
||||
if ($^O eq "linux") {
|
||||
Build::Command("tar zcvf $filename addons");
|
||||
} else {
|
||||
Build::Command("zip -r $filename addons");
|
||||
}
|
||||
Build::Move($filename, Build::PathFormat('../../'));
|
||||
chdir(Build::PathFormat('../..'));
|
||||
}
|
||||
|
||||
my ($ftp);
|
||||
$ftp_path .= "/$major.$minor";
|
||||
|
||||
$ftp = Net::FTP->new($ftp_host, Debug => 0, Passive => 0)
|
||||
or die "Cannot connect to host $ftp_host: $@";
|
||||
@ -51,11 +76,10 @@ $ftp->login($ftp_user, $ftp_pass)
|
||||
if ($ftp_path ne '')
|
||||
{
|
||||
$ftp->cwd($ftp_path)
|
||||
or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n";
|
||||
or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n";
|
||||
}
|
||||
|
||||
$ftp->binary();
|
||||
my ($i);
|
||||
for ($i = 0; $i <= $#packages; $i++) {
|
||||
my ($filename);
|
||||
if ($^O eq "linux") {
|
||||
|
@ -7,7 +7,7 @@ chdir($path);
|
||||
|
||||
require 'helpers.pm';
|
||||
|
||||
chdir('../../OUTPUT');
|
||||
chdir('../../../OUTPUT');
|
||||
|
||||
my $argn = $#ARGV + 1;
|
||||
if ($argn > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user