Skip to content

Commit 3e6f115

Browse files
committed
Fixed DockerBuild.ps1 clean. Fixed missing artifacts warning.
1 parent 37e4a6a commit 3e6f115

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/PostSharp.Engineering.BuildTools/Build/Testing/TestCommand.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ public static bool Execute( BuildContext context, BuildSettings settings )
109109

110110
File.WriteAllText( emptyFile, "This file is intentionally empty." );
111111
}
112+
113+
var dumpDirectory = Path.Combine( context.RepoDirectory, product.DumpDirectory );
114+
115+
if ( !Directory.GetFiles( dumpDirectory ).Any() )
116+
{
117+
// We have to create an empty file, otherwise TeamCity will complain that
118+
// artifacts are missing.
119+
var emptyFile = Path.Combine( dumpDirectory, ".empty" );
120+
121+
File.WriteAllText( emptyFile, "This file is intentionally empty." );
122+
}
112123

113124
// Raise the post-test event.
114125
var buildInfo = BuildArguments.Read( context, settings.BuildConfiguration );

src/PostSharp.Engineering.BuildTools/Resources/DockerBuild.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ if (-not $env:IS_TEAMCITY_AGENT -and -not $NoClean)
112112
Write-Host "Cleaning up." -ForegroundColor Green
113113
if (Test-Path "artifacts")
114114
{
115-
Remove-Item artifacts -Force -Recurse -ProgressAction SilentlyContinue
115+
Remove-Item artifacts -Force -Recurse -ErrorAction SilentlyContinue
116116
}
117-
Get-ChildItem @("bin", "obj") -Recurse | Remove-Item -Force -Recurse -ProgressAction SilentlyContinue
117+
Get-ChildItem "bin" -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
118+
Get-ChildItem "obj" -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
118119
}
119120

120121
# Create secrets JSON file.

0 commit comments

Comments
 (0)