Skip to content

Commit

Permalink
Merge pull request #1202 from Unity-Technologies/stevedore-7z
Browse files Browse the repository at this point in the history
Automate creating stevedore mbe artifact
  • Loading branch information
ashwinimurt authored Jul 10, 2019
2 parents e638bc8 + dde1d2f commit bab11be
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ docs/perlmod*
artifacts
.vs
external/buildscripts/build.gen*
stevedore

# Allow
!external/buildscripts/bee.exe
Expand Down
20 changes: 15 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,17 @@ build_linux_x86:
- /opt/post_build_script.sh

collate_builds:
image: ubuntu:latest
stage: collate
tags:
- bokken-job
variables:
BOKKEN_VM: collate_ubuntu
BOKKEN_JOB: |
resources:
- name: collate_ubuntu
image: cds-ops/ubuntu-18.04-agent:v1.0.11-765607
flavor: b1.large
type: Unity::VM
dependencies:
- build_android
- build_osx_runtime
Expand All @@ -249,17 +258,18 @@ collate_builds:
- build_linux_x86
- build_linux_x64
before_script:
- apt-get update -qy && apt-get -qy upgrade
- apt-get install -qy perl
- apt-get install -qy zip unzip
- apt-get install -qy p7zip-full p7zip-rar
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -qy && sudo DEBIAN_FRONTEND=noninteractive apt-get -qy upgrade
- sudo apt-get install -qy zip unzip
- sudo apt-get install -qy p7zip-full p7zip-rar
script:
- perl external/buildscripts/collect_allbuilds.pl
- pwd
- ls -al
artifacts:
paths:
- collectedbuilds/builds.7z
- stevedore/MonoBleedingEdge.7z
- stevedore/artifactid.txt
expire_in: 1 week


Expand Down
4 changes: 4 additions & 0 deletions .yamato/collate_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ artifacts:
builds:
paths:
- collectedbuilds/builds.7z
stevedore:
paths:
- stevedore/MonoBleedingEdge.7z
- stevedore/artifactid.txt
44 changes: 42 additions & 2 deletions external/buildscripts/collect_allbuilds.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
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");

my $externalzip = "";
if($^O eq "linux")
{
Expand All @@ -61,6 +59,46 @@
$externalzip = "$monoroot/../../mono-build-deps/build/7z/osx/7za";
}


# Create stevedore artifact
print(">>> Create stevedore artifact $monoroot/stevedore/MonoBleedingEdge.7z");
if($^O eq "linux" || $^O eq 'darwin')
{
rmtree("../stevedore");
my $stevedoreMbePath = "../stevedore/MonoBleedingEdge";
my $stevedoreMbeBuildsPath = "../stevedore/MonoBleedingEdge/builds";
my $stevedoreMbe7z = "../stevedore/MonoBleedingEdge.7z";
my $stevedoreMbeArtifactID = "../stevedore/artifactid.txt";

system("mkdir -p $stevedoreMbeBuildsPath") eq 0 or die("failed to mkdir $stevedoreMbeBuildsPath");
system("cp -r * $stevedoreMbeBuildsPath/") eq 0 or die ("failed copying builds to $stevedoreMbeBuildsPath\n");
if(-f $externalzip)
{
system("$externalzip a $stevedoreMbe7z $stevedoreMbePath/* -sdel") eq 0 or die("failed 7z up $stevedoreMbePath");
}
else
{
#Use 7z installed on the machine. If its not installed, please install it.
system("7z a $stevedoreMbe7z $stevedoreMbePath/* -sdel") eq 0 or die("failed 7z up $stevedoreMbePath");
}
system("rm -rf $stevedoreMbePath") eq 0 or die("failed to delete $stevedoreMbePath");

# Write stevedore artifact ID to file
my $revision = `git rev-parse --short HEAD`;
system("mono ../external/buildscripts/bee.exe steve new $stevedoreMbe7z MonoBleedingEdge $revision") eq 0 or die("failed running bee");
open (my $file, '>', $stevedoreMbeArtifactID);
my $artifactID = `mono ../external/buildscripts/bee.exe steve new $stevedoreMbe7z MonoBleedingEdge $revision`;
print $file $artifactID;
print (">>> MonoBleedingEdge stevedore artifact ID: $artifactID\n");
}
else
{
die("Unsupported platform to create stevedore artifact.")
}
print(">>> Done creating stevedore artifact $monoroot/MonoBleedingEdge.7z");

system("zip -r builds.zip *") eq 0 or die("failed zipping up builds");

if($^O eq "linux" || $^O eq 'darwin')
{
if(-f $externalzip)
Expand All @@ -78,3 +116,5 @@
die("Unsupported platform for build collection.")
}



0 comments on commit bab11be

Please sign in to comment.