generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the release tag into the container as env var and display i…
…n the AppInfo json response Merge pull request #242 from DFE-Digital/Feature/update-app-info
- Loading branch information
Showing
7 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 19 additions & 19 deletions
38
Childrens-Social-Care-CPD/Controllers/AppInfoController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
using Childrens_Social_Care_CPD.Models; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Childrens_Social_Care_CPD.Controllers | ||
namespace Childrens_Social_Care_CPD.Controllers; | ||
|
||
public class AppInfoController : Controller | ||
{ | ||
public class AppInfoController : Controller | ||
{ | ||
private readonly IApplicationConfiguration _applicationConfiguration; | ||
private readonly IApplicationConfiguration _applicationConfiguration; | ||
|
||
public AppInfoController(IApplicationConfiguration applicationConfiguration) | ||
{ | ||
_applicationConfiguration = applicationConfiguration; | ||
} | ||
public AppInfoController(IApplicationConfiguration applicationConfiguration) | ||
{ | ||
_applicationConfiguration = applicationConfiguration; | ||
} | ||
|
||
[HttpGet] | ||
[Route("CPD/AppInfo")] | ||
public JsonResult AppInfo() | ||
[HttpGet] | ||
[Route("CPD/AppInfo")] | ||
public JsonResult AppInfo() | ||
{ | ||
var applicationInfo = new ApplicationInfo() | ||
{ | ||
var applicationInfo = new ApplicationInfo() | ||
{ | ||
Environment = _applicationConfiguration.AzureEnvironment, | ||
ContentfulEnvironment = _applicationConfiguration.ContentfulEnvironment, | ||
GitShortHash = _applicationConfiguration.GitHash | ||
}; | ||
Environment = _applicationConfiguration.AzureEnvironment, | ||
ContentfulEnvironment = _applicationConfiguration.ContentfulEnvironment, | ||
GitShortHash = _applicationConfiguration.GitHash, | ||
Version = _applicationConfiguration.AppVersion, | ||
}; | ||
|
||
return Json(applicationInfo); | ||
} | ||
return Json(applicationInfo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
using Newtonsoft.Json; | ||
namespace Childrens_Social_Care_CPD.Models; | ||
|
||
namespace Childrens_Social_Care_CPD.Models | ||
public class ApplicationInfo | ||
{ | ||
public class ApplicationInfo | ||
{ | ||
public string Environment { get; set; } | ||
public string ContentfulEnvironment { get; set; } | ||
public string GitShortHash { get; set; } | ||
} | ||
public string ContentfulEnvironment { get; set; } | ||
public string Environment { get; set; } | ||
public string GitShortHash { get; set; } | ||
public string Version { get; set; } | ||
} |