### 버전 정보 표시 기능 - CI/CD에서 빌드 시간과 git commit hash를 version.txt에 기록 - Web과 Admin 앱이 시작 시 version.txt를 읽어 VersionInfo 싱글톤으로 등록 - 홈페이지 푸터에 "버전: <커밋해시> | 배포: <빌드시간>" 표시 - 최신 소스 반영 여부를 즉시 확인 가능 ### 포트 충돌 해결 - 배포 후 기존 프로세스 종료 시 포트 릴리스 대기 로직 추가 - lsof 명령으로 포트 사용 여부 확인 (최대 30초 대기) - 5001/5002 포트가 완전히 릴리스될 때까지 new process 시작 지연 - "Address already in use" 오류 해결 파일 변경: - .gitea/workflows/deploy.yml: 버전 파일 생성 + 포트 대기 로직 - TaxBaik.Web/Program.cs: version.txt 읽기 + VersionInfo 등록 - TaxBaik.Admin/Program.cs: version.txt 읽기 + VersionInfo 등록 - TaxBaik.Web/Pages/Shared/_Footer.cshtml: 버전 정보 표시 - TaxBaik.Web/VersionInfo.cs: 새로 추가 - TaxBaik.Admin/VersionInfo.cs: 새로 추가 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
@inject VersionInfo VersionInfo
|
||||
|
||||
<footer class="bg-light border-top mt-5 py-4">
|
||||
<div class="container">
|
||||
<div class="row g-4">
|
||||
@@ -28,6 +30,9 @@
|
||||
<p>© 2026 백원숙 세무회계. All rights reserved.</p>
|
||||
<a href="/taxbaik/privacy" class="text-decoration-none text-muted me-2">개인정보처리방침</a>
|
||||
<a href="/taxbaik/terms" class="text-decoration-none text-muted">이용약관</a>
|
||||
<div class="mt-2" style="font-size: 0.75rem; opacity: 0.7;">
|
||||
🔄 버전: @VersionInfo.Version | 배포: @VersionInfo.Built
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -13,6 +13,22 @@ builder.Services.AddResponseCompression(opts => {
|
||||
builder.Services.AddInfrastructure();
|
||||
builder.Services.AddApplication();
|
||||
|
||||
// Register version info
|
||||
var versionInfo = new VersionInfo();
|
||||
var versionFilePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "version.txt");
|
||||
if (File.Exists(versionFilePath))
|
||||
{
|
||||
var lines = File.ReadAllLines(versionFilePath);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
if (line.StartsWith("Version:"))
|
||||
versionInfo.Version = line.Substring("Version:".Length).Trim();
|
||||
else if (line.StartsWith("Built:"))
|
||||
versionInfo.Built = line.Substring("Built:".Length).Trim();
|
||||
}
|
||||
}
|
||||
builder.Services.AddSingleton(versionInfo);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Run migrations on startup
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace TaxBaik.Web;
|
||||
|
||||
public class VersionInfo
|
||||
{
|
||||
public string Version { get; set; } = "unknown";
|
||||
public string Built { get; set; } = "unknown";
|
||||
}
|
||||
Reference in New Issue
Block a user