Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d9937c590 | |||
| ef6f9c74f6 | |||
| 24ec410f3d | |||
| 024122d310 | |||
| c6f269e30a | |||
| 97447a551f |
@@ -2,7 +2,7 @@ name: Deploy to Production
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: [Prepare Release]
|
workflows: ["Prepare Release"]
|
||||||
types: [completed]
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
name: Prepare Release
|
name: Prepare Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_run:
|
||||||
branches: [main]
|
workflows: ["Validators (Pushes and Pull Requests)"]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
@@ -16,6 +17,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
name: Build & Create Release
|
name: Build & Create Release
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
outputs:
|
outputs:
|
||||||
@@ -94,6 +96,10 @@ jobs:
|
|||||||
--no-restore \
|
--no-restore \
|
||||||
--no-build
|
--no-build
|
||||||
|
|
||||||
|
- name: Write Version Text
|
||||||
|
run: |
|
||||||
|
echo "${{ steps.metadata.outputs.version }}" > ./publish/version.txt
|
||||||
|
|
||||||
- name: Write Production Config
|
- name: Write Production Config
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./publish
|
mkdir -p ./publish
|
||||||
|
|||||||
@@ -22,6 +22,20 @@ public class LoginModel : PageModel
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
// 1. Try reading version.txt from application base directory
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var txtPath = Path.Combine(AppContext.BaseDirectory, "version.txt");
|
||||||
|
if (System.IO.File.Exists(txtPath))
|
||||||
|
{
|
||||||
|
var txtVersion = System.IO.File.ReadAllText(txtPath).Trim();
|
||||||
|
if (!string.IsNullOrEmpty(txtVersion))
|
||||||
|
return txtVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
|
||||||
|
// 2. Try reading raw assembly version
|
||||||
var rawVersion = Assembly.GetEntryAssembly()
|
var rawVersion = Assembly.GetEntryAssembly()
|
||||||
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||||
?.InformationalVersion;
|
?.InformationalVersion;
|
||||||
@@ -31,8 +45,9 @@ public class LoginModel : PageModel
|
|||||||
return rawVersion;
|
return rawVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. Fallback to dynamic local Git parsing if available
|
||||||
var dateStr = DateTime.UtcNow.AddHours(9).ToString("yyyyMMdd");
|
var dateStr = DateTime.UtcNow.AddHours(9).ToString("yyyyMMdd");
|
||||||
string gitHash = "a9986fb";
|
string gitHash = "024122d";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var baseDir = AppContext.BaseDirectory;
|
var baseDir = AppContext.BaseDirectory;
|
||||||
@@ -55,7 +70,7 @@ public class LoginModel : PageModel
|
|||||||
var headContent = System.IO.File.ReadAllText(headPath).Trim();
|
var headContent = System.IO.File.ReadAllText(headPath).Trim();
|
||||||
if (headContent.StartsWith("ref:"))
|
if (headContent.StartsWith("ref:"))
|
||||||
{
|
{
|
||||||
var refPath = Path.Combine(repoRoot, ".git", headContent.Substring(4).Trim());
|
var refPath = Path.Combine(repoRoot, ".git", headContent.Substring(4).Trim().Replace('/', Path.DirectorySeparatorChar));
|
||||||
if (System.IO.File.Exists(refPath))
|
if (System.IO.File.Exists(refPath))
|
||||||
{
|
{
|
||||||
var fullHash = System.IO.File.ReadAllText(refPath).Trim();
|
var fullHash = System.IO.File.ReadAllText(refPath).Trim();
|
||||||
@@ -72,7 +87,7 @@ public class LoginModel : PageModel
|
|||||||
}
|
}
|
||||||
catch {}
|
catch {}
|
||||||
|
|
||||||
int runCount = 14;
|
int runCount = 11;
|
||||||
return $"quant_{dateStr}.{runCount}.{gitHash}";
|
return $"quant_{dateStr}.{runCount}.{gitHash}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,20 @@ public class IndexModel : PageModel
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
// 1. Try reading version.txt from application base directory
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var txtPath = Path.Combine(AppContext.BaseDirectory, "version.txt");
|
||||||
|
if (System.IO.File.Exists(txtPath))
|
||||||
|
{
|
||||||
|
var txtVersion = System.IO.File.ReadAllText(txtPath).Trim();
|
||||||
|
if (!string.IsNullOrEmpty(txtVersion))
|
||||||
|
return txtVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
|
||||||
|
// 2. Try reading raw assembly version
|
||||||
var rawVersion = Assembly.GetEntryAssembly()
|
var rawVersion = Assembly.GetEntryAssembly()
|
||||||
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||||
?.InformationalVersion;
|
?.InformationalVersion;
|
||||||
@@ -32,8 +46,9 @@ public class IndexModel : PageModel
|
|||||||
return rawVersion;
|
return rawVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. Fallback to dynamic local Git parsing if available
|
||||||
var dateStr = DateTime.UtcNow.AddHours(9).ToString("yyyyMMdd");
|
var dateStr = DateTime.UtcNow.AddHours(9).ToString("yyyyMMdd");
|
||||||
string gitHash = "a9986fb";
|
string gitHash = "024122d";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var baseDir = AppContext.BaseDirectory;
|
var baseDir = AppContext.BaseDirectory;
|
||||||
@@ -56,7 +71,7 @@ public class IndexModel : PageModel
|
|||||||
var headContent = System.IO.File.ReadAllText(headPath).Trim();
|
var headContent = System.IO.File.ReadAllText(headPath).Trim();
|
||||||
if (headContent.StartsWith("ref:"))
|
if (headContent.StartsWith("ref:"))
|
||||||
{
|
{
|
||||||
var refPath = Path.Combine(repoRoot, ".git", headContent.Substring(4).Trim());
|
var refPath = Path.Combine(repoRoot, ".git", headContent.Substring(4).Trim().Replace('/', Path.DirectorySeparatorChar));
|
||||||
if (System.IO.File.Exists(refPath))
|
if (System.IO.File.Exists(refPath))
|
||||||
{
|
{
|
||||||
var fullHash = System.IO.File.ReadAllText(refPath).Trim();
|
var fullHash = System.IO.File.ReadAllText(refPath).Trim();
|
||||||
@@ -73,7 +88,7 @@ public class IndexModel : PageModel
|
|||||||
}
|
}
|
||||||
catch {}
|
catch {}
|
||||||
|
|
||||||
int runCount = 14;
|
int runCount = 11;
|
||||||
return $"quant_{dateStr}.{runCount}.{gitHash}";
|
return $"quant_{dateStr}.{runCount}.{gitHash}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" asp-page-handler="TriggerJob" class="d-inline">
|
<form method="post" action="/Admin/Operations?handler=TriggerJob" class="d-inline">
|
||||||
@Html.AntiForgeryToken()
|
@Html.AntiForgeryToken()
|
||||||
<input type="hidden" name="jobId" value="@job.JobId" />
|
<input type="hidden" name="jobId" value="@job.JobId" />
|
||||||
<button type="submit" class="btn btn-sm btn-success text-white">즉시 실행</button>
|
<button type="submit" class="btn btn-sm btn-success text-white">즉시 실행</button>
|
||||||
|
|||||||
@@ -87,18 +87,26 @@ public class IndexModel : PageModel
|
|||||||
InactiveJobsCount = TotalJobsCount - ActiveJobsCount;
|
InactiveJobsCount = TotalJobsCount - ActiveJobsCount;
|
||||||
|
|
||||||
var succeeded = monitoringApi.SucceededJobs(0, 10)
|
var succeeded = monitoringApi.SucceededJobs(0, 10)
|
||||||
.Select(kv => new JobExecutionInfo(
|
.Select(kv => {
|
||||||
kv.Value.Job?.Method.Name ?? kv.Key,
|
var succeededAt = kv.Value.SucceededAt ?? DateTime.UtcNow;
|
||||||
kv.Value.SucceededAt ?? DateTime.UtcNow,
|
var durationMs = kv.Value.TotalDuration ?? 0;
|
||||||
kv.Value.SucceededAt,
|
var startedAt = succeededAt.AddMilliseconds(-durationMs);
|
||||||
true));
|
return new JobExecutionInfo(
|
||||||
|
kv.Value.Job?.Method.Name ?? kv.Key,
|
||||||
|
startedAt,
|
||||||
|
succeededAt,
|
||||||
|
true);
|
||||||
|
});
|
||||||
|
|
||||||
var failed = monitoringApi.FailedJobs(0, 10)
|
var failed = monitoringApi.FailedJobs(0, 10)
|
||||||
.Select(kv => new JobExecutionInfo(
|
.Select(kv => {
|
||||||
kv.Value.Job?.Method.Name ?? kv.Key,
|
var failedAt = kv.Value.FailedAt ?? DateTime.UtcNow;
|
||||||
kv.Value.FailedAt ?? DateTime.UtcNow,
|
return new JobExecutionInfo(
|
||||||
kv.Value.FailedAt,
|
kv.Value.Job?.Method.Name ?? kv.Key,
|
||||||
false));
|
failedAt,
|
||||||
|
failedAt,
|
||||||
|
false);
|
||||||
|
});
|
||||||
|
|
||||||
RecentExecutions = succeeded.Concat(failed)
|
RecentExecutions = succeeded.Concat(failed)
|
||||||
.OrderByDescending(e => e.StartedAt)
|
.OrderByDescending(e => e.StartedAt)
|
||||||
|
|||||||
Reference in New Issue
Block a user