feat(deploy): add an isolated demo stand with synthetic seed and guarded reset
This commit is contained in:
1 parent
bd23c839fd
commit
e1df4ff77c
26 files changed
+3292
-2
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Command demo-seed seeds the synthetic demonstration world of an isolated
|
||||
// demo stand, checks whether a reset may discard the stand's database, and
|
||||
// prints an inventory of counts. It requires DEMO_MODE=isolated.
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"lincodex/backend/internal/adapter/primary/cli/demoseed"
|
||||
)
|
||||
|
||||
func main() {
|
||||
os.Exit(run())
|
||||
}
|
||||
|
||||
func run() int {
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
if err := demoseed.Run(ctx, os.Args[1:], os.LookupEnv, os.Stdout, time.Now); err != nil {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "demo-seed: %v\n", err)
|
||||
return 2
|
||||
}
|
||||
return 0
|
||||
}
|
||||
Reference in new issue
Block a user