forked from apps/featurer
Initial commit.
This commit is contained in:
21
server/cmd/cms/Taskfile.yml
Normal file
21
server/cmd/cms/Taskfile.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
build:
|
||||
desc: "Builds Featurer's CMS binary."
|
||||
cmds:
|
||||
- task: cleanup
|
||||
- go build -ldflags="{{ .LDFLAGS }}" -tags netgo -o _build/featurer-cms{{exeExt}} ./server/cmd/cms/main.go
|
||||
sources:
|
||||
- ./**/*.go
|
||||
- ./Taskfile.yml
|
||||
- ./go.mod
|
||||
generates:
|
||||
- ./_build/featurer-cms{{exeExt}}
|
||||
method: none
|
||||
|
||||
cleanup:
|
||||
desc: "Deletes Featurer's CMS binary from local build cache."
|
||||
cmds:
|
||||
- rm -f _build/featurer-cms{{exeExt}}
|
42
server/cmd/cms/main.go
Normal file
42
server/cmd/cms/main.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
"go.dev.pztrn.name/featurer/server/internal/application"
|
||||
"go.dev.pztrn.name/featurer/server/internal/services/core/datastore"
|
||||
)
|
||||
|
||||
func main() {
|
||||
_ = slog.SetLogLoggerLevel(slog.LevelDebug)
|
||||
|
||||
app := application.New()
|
||||
|
||||
slog.Info(
|
||||
"Launching Featurer's CMS...",
|
||||
"version", application.Version,
|
||||
"build", application.Build,
|
||||
"branch", application.Branch,
|
||||
"commit", application.Commit,
|
||||
"build date", application.BuildDate,
|
||||
)
|
||||
|
||||
// Initializing core services first.
|
||||
checkError(datastore.Initialize(app))
|
||||
|
||||
// Then - features services.
|
||||
|
||||
// Start application.
|
||||
checkError(app.Start())
|
||||
|
||||
<-app.GetShutdownDoneChannel()
|
||||
slog.Info("Featurer's CMS.")
|
||||
}
|
||||
|
||||
func checkError(err error) {
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
panic(err)
|
||||
}
|
Reference in New Issue
Block a user