fix system controller not initialized
This commit is contained in:
@@ -10,6 +10,7 @@ env:
|
|||||||
MIGRATE_BINARY: "acc-server-migration"
|
MIGRATE_BINARY: "acc-server-migration"
|
||||||
DEPLOY_PATH: 'C:\acc-server-manager'
|
DEPLOY_PATH: 'C:\acc-server-manager'
|
||||||
SERVICE_NAME: "ACC Server Manager"
|
SERVICE_NAME: "ACC Server Manager"
|
||||||
|
PORT: "4000"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -135,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
while ($attempt -le $maxAttempts -and -not $success) {
|
while ($attempt -le $maxAttempts -and -not $success) {
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest -Uri "http://localhost:8080/health" -TimeoutSec 5
|
$response = Invoke-WebRequest -Uri "http://localhost:{{ env.PORT }}/system/health" -TimeoutSec 5
|
||||||
if ($response.StatusCode -eq 200) {
|
if ($response.StatusCode -eq 200) {
|
||||||
Write-Host "Health check passed!"
|
Write-Host "Health check passed!"
|
||||||
$success = $true
|
$success = $true
|
||||||
@@ -150,31 +151,3 @@ jobs:
|
|||||||
if (-not $success) {
|
if (-not $success) {
|
||||||
throw "Health check failed after $maxAttempts attempts"
|
throw "Health check failed after $maxAttempts attempts"
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Notify on success
|
|
||||||
if: success()
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { repo, owner } = context.repo;
|
|
||||||
const release = context.ref.replace('refs/tags/', '');
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
body: `✅ Successfully deployed ${release} to production!`
|
|
||||||
});
|
|
||||||
|
|
||||||
- name: Notify on failure
|
|
||||||
if: failure()
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { repo, owner } = context.repo;
|
|
||||||
const release = context.ref.replace('refs/tags/', '');
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
body: `❌ Failed to deploy ${release} to production. Check the workflow logs for details.`
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ func InitializeControllers(c *dig.Container) {
|
|||||||
logging.Panic("unable to initialize auth middleware")
|
logging.Panic("unable to initialize auth middleware")
|
||||||
}
|
}
|
||||||
|
|
||||||
err := c.Invoke(NewServiceControlController)
|
err := c.Invoke(NewSystemController)
|
||||||
|
if err != nil {
|
||||||
|
logging.Panic("unable to initialize system controller")
|
||||||
|
}
|
||||||
|
|
||||||
|
err = c.Invoke(NewServiceControlController)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.Panic("unable to initialize service control controller")
|
logging.Panic("unable to initialize service control controller")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"acc-server-manager/local/utl/common"
|
"acc-server-manager/local/utl/common"
|
||||||
|
"acc-server-manager/local/utl/configs"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
)
|
)
|
||||||
@@ -34,5 +35,5 @@ func NewSystemController(routeGroups *common.RouteGroups) *SystemController {
|
|||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Router /v1/service-control [get]
|
// @Router /v1/service-control [get]
|
||||||
func (ac *SystemController) getFirst(c *fiber.Ctx) error {
|
func (ac *SystemController) getFirst(c *fiber.Ctx) error {
|
||||||
return c.SendStatus(fiber.StatusOK)
|
return c.SendString(configs.Version)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Version = "0.0.1"
|
Version = "0.10.1"
|
||||||
Prefix = "v1"
|
Prefix = "v1"
|
||||||
Secret string
|
Secret string
|
||||||
SecretCode string
|
SecretCode string
|
||||||
|
|||||||
Reference in New Issue
Block a user