### 버전 정보 표시 기능 - 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user