diff --git a/FitConnect/FitConnect.csproj b/FitConnect/FitConnect.csproj index da9cb9f13b7665b3aaccbdd67604a5f788aadbe2..dfcb34730551c154bf21a8546d3c7be1b991b6f1 100644 --- a/FitConnect/FitConnect.csproj +++ b/FitConnect/FitConnect.csproj @@ -49,6 +49,9 @@ <EmbeddedResource Include="TrustedRootCertificates\PCA-1-Verwaltung-17.pem" /> <None Remove="Certificates\PCA-1-Verwaltung-20.pem" /> <EmbeddedResource Include="TrustedRootCertificates\PCA-1-Verwaltung-20.pem" /> + <None Update="commitId.tmp"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> </ItemGroup> <ItemGroup> @@ -63,4 +66,8 @@ <Compile Remove="Services\Models\v1\Api\ReplyChannel.cs" /> </ItemGroup> + <Target Name="PreBuild" BeforeTargets="PreBuildEvent"> + <Exec Command="git rev-parse --short HEAD > commitId.tmp" /> + </Target> + </Project> diff --git a/FitConnect/ProjectSpecification.cs b/FitConnect/ProjectSpecification.cs index 8e5a4e62f197553f09e9553439c344718bf445c3..887899d058de6a18c25c04ca7afa06a4e16f60e5 100644 --- a/FitConnect/ProjectSpecification.cs +++ b/FitConnect/ProjectSpecification.cs @@ -18,7 +18,9 @@ internal static class ProjectSpecification { private static string? GetCommitId() { const string commitFileName = "commitId.tmp"; - return File.Exists(commitFileName) ? File.ReadAllText(commitFileName) : null; + return File.Exists(commitFileName) + ? File.ReadAllLines(commitFileName).First() + : "development"; } public static byte[] CalculateCallbackHmac(string callbackSecret, long timestamp, string body) {