Skip to content

Commit

Permalink
Add retry logic for writing Jenkins build number FileOperationWithRetry
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Jan 19, 2018
1 parent 56aa424 commit 743c50d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NerdBank.GitVersioning/CloudBuildServices/Jenkins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static void WriteVersionFile(string buildNumber)

var versionFilePath = Path.Combine(workspacePath, "jenkins_build_number.txt");

File.WriteAllText(versionFilePath, buildNumber, UTF8NoBOM);
Utilities.FileOperationWithRetry(() => File.WriteAllText(versionFilePath, buildNumber, UTF8NoBOM));
}
}
}
3 changes: 3 additions & 0 deletions src/NerdBank.GitVersioning/NerdBank.GitVersioning.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
<PackageReference Include="Nerdbank.GitVersioning.LKG" Version="1.6.20-beta-gfea83a8c9e" />
<PackageReference Include="NuProj.Common" Version="0.11.14-beta" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Shared\Utilities.cs" LinkBase="Shared" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
<ProjectReference Include="..\MSBuildExtensionTask\MSBuildExtensionTask.csproj" />
<ProjectReference Include="..\NerdBank.GitVersioning\NerdBank.GitVersioning.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Shared\Utilities.cs" LinkBase="Shared" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using Validation;

namespace Nerdbank.GitVersioning.Tasks
namespace Nerdbank.GitVersioning
{
internal static class Utilities
{
Expand Down

0 comments on commit 743c50d

Please sign in to comment.