forked from Unity-Technologies/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
collect_allbuilds.pl
40 lines (32 loc) · 1.46 KB
/
collect_allbuilds.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use lib ('./perl_lib');
use File::Copy::Recursive qw(dircopy rmove);
use File::Path;
use Tools qw(InstallNameTool);
my $path = "incomingbuilds/";
rmtree("collectedbuilds");
mkpath("collectedbuilds");
my @folders = ();
opendir(DIR, $path) or die "cant find $path: $!";
while (defined(my $file = readdir(DIR))) {
next if $file =~ /^\.\.?$/;
if (-d "$path$file"){
if (-f "$path$file/versions.txt") {
system("cat $path$file/versions.txt >> collectedbuilds/versions-aggregated.txt");
system("echo \"\" >> collectedbuilds/versions-aggregated.txt");
}
dircopy("$path$file","collectedbuilds/") or die ("failed copying $path$file");
push @folders,"$path$file";
}
}
closedir(DIR);
system("find collectedbuilds -type f -name mono -exec chmod +x {} \\;") eq 0 or die("Failed chmodding");
system("find collectedbuilds -type f -name mono-sgen -exec chmod +x {} \\;") eq 0 or die("Failed chmodding");
system("find collectedbuilds -type f -name pedump -exec chmod +x {} \\;") eq 0 or die("Failed chmodding");
chdir("collectedbuilds");
rmove('versions-aggregated.txt', 'versions.txt');
open(MYFILE,">built_by_teamcity.txt");
print MYFILE "These builds were created by teamcity from svn revision $ENV{BUILD_VCS_NUMBER}\n";
print MYFILE "TC projectname was: $ENV{TEAMCITY_PROJECT_NAME}\n";
print MYFILE "TC buildconfigname was: $ENV{TEAMCITY_BUILDCONF_NAME}\n";
close(MYFILE);
system("zip -r builds.zip *") eq 0 or die("failed zipping up builds");