Skip to content

Commit d3614d4

Browse files
committed
Fix Yamato jobs to fail in case of a build or test error!
The issue is that the logs are piped using `tee` to create a clean log file See for instance: perl build.pl | tee linux_build.txt That's the wrong idea in the first place, the logs in Yamato have colors, are searchable etc. I initially provided a complex solution (Using Bash set -o pipefail to fail the whole pipeline if the first command file, and PowerShell $LASTEXITCODE to fail in case of an error) but I believe the simplicity here should be the key
1 parent 84a47e2 commit d3614d4

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

.yamato/linux-build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ agent:
55
flavor: b1.large
66

77
commands:
8+
# Build PerforcePlugin and TestServer
9+
- perl build.pl
10+
# Run the tests (requires Perforce P4 CLI)
811
- hg clone --config extensions.largefiles= http://hg-mirror-slo.hq.unity3d.com/unity-extra/perforce PerforceBinaries
9-
- perl build.pl | tee linux_build.txt
10-
- perl build.pl -test | tee linux_test.txt
12+
- perl build.pl -test
1113

1214
artifacts:
1315
builds:
1416
paths:
1517
- "Build/linux64/PerforcePlugin"
16-
logs:
17-
paths:
18-
- "linux_build.txt"
19-
- "linux_test.txt"

.yamato/osx-build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ agent:
55
flavor: b1.large
66

77
commands:
8+
# Build PerforcePlugin and TestServer
9+
- perl build.pl
10+
# Run the tests (requires Perforce P4 CLI)
811
- hg clone --config extensions.largefiles= http://hg-mirror-slo.hq.unity3d.com/unity-extra/perforce PerforceBinaries
9-
- perl build.pl | tee mac_build.txt
10-
- perl build.pl -test | tee mac_test.txt
12+
- perl build.pl -test
1113

1214
artifacts:
1315
builds:
1416
paths:
1517
- "Build/OSXx64/PerforcePlugin"
16-
logs:
17-
paths:
18-
- "mac_build.txt"
19-
- "mac_test.txt"

.yamato/windows-build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ agent:
66

77
interpreter: powershell
88
commands:
9-
- perl build.pl | tee win_build.txt
9+
# Build PerforcePlugin and TestServer
10+
- perl build.pl
11+
# Run the tests (requires Perforce P4 CLI)
1012
- hg clone --config extensions.largefiles= http://hg-mirror-slo.hq.unity3d.com/unity-extra/perforce PerforceBinaries
11-
- perl build.pl -test | tee win_test.txt
13+
- perl build.pl -test
1214

1315
artifacts:
1416
builds:
1517
paths:
1618
- "Build/Win32/PerforcePlugin.exe"
1719
- "Build/Win32/PerforcePlugin.pdb"
18-
logs:
19-
paths:
20-
- "win_build.txt"
21-
- "win_test.txt"

0 commit comments

Comments
 (0)