Client build scripts fixes and server stub with local devzone.
All checks were successful
Linting and tests / Linting (push) Successful in 6s
All checks were successful
Linting and tests / Linting (push) Successful in 6s
This commit is contained in:
5
server/cmd/Taskfile.yml
Normal file
5
server/cmd/Taskfile.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
includes:
|
||||
bunkerd: ./bunkerd
|
26
server/cmd/bunkerd/Taskfile.yml
Normal file
26
server/cmd/bunkerd/Taskfile.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
build:
|
||||
desc: "Builds bunkerd binary."
|
||||
cmds:
|
||||
- task: :::ensure-builddir
|
||||
- task: cleanup
|
||||
- go build -ldflags="{{ .BASIC_LDFLAGS }}" -o _build/bunkerd{{exeExt}} ./server/cmd/bunkerd/main.go
|
||||
sources:
|
||||
- ./Taskfile.yml
|
||||
- ./go.mod
|
||||
- ./commons/*
|
||||
- ./server/**/*.go
|
||||
- ./server/Taskfile.yml
|
||||
- ./server/**/Taskfile.yml
|
||||
- ./server/entrypoint.sh
|
||||
generates:
|
||||
- ./_build/bunkerd{{exeExt}}
|
||||
method: timestamp
|
||||
|
||||
cleanup:
|
||||
desc: "Deletes bunkerd binary from local build cache."
|
||||
cmds:
|
||||
- rm -f _build/bunkerd{{exeExt}}
|
39
server/cmd/bunkerd/main.go
Normal file
39
server/cmd/bunkerd/main.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"bunker/commons"
|
||||
"bunker/server/internal/application"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := application.New()
|
||||
|
||||
lgr := app.NewLogger("module", "main")
|
||||
lgr.Info(
|
||||
"Starting bunkerd...",
|
||||
"version", commons.Version,
|
||||
"build_no", commons.Build,
|
||||
"buint_on", commons.BuildDate,
|
||||
"commit", commons.Commit,
|
||||
"branch", commons.Branch,
|
||||
)
|
||||
|
||||
if err := app.Start(); err != nil {
|
||||
lgr.Error("Failed to start bunkerd!", "error", err.Error())
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
lgr.Info("bunkerd started.")
|
||||
|
||||
<-app.ShutdownChan()
|
||||
lgr.Info("Shutting down bunkerd...")
|
||||
|
||||
if err := app.Shutdown(); err != nil {
|
||||
lgr.Error("Failed to shutdown bunkerd!", "error", err.Error())
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user