1
0

feat: initial daemon implementation

This commit is contained in:
2024-02-20 13:25:31 +00:00
parent 820208d079
commit 0314b5ca93
45 changed files with 2989 additions and 1041 deletions

View File

@@ -9,6 +9,8 @@ import (
"os"
"time"
"code.dumpstack.io/tools/out-of-tree/artifact"
"code.dumpstack.io/tools/out-of-tree/config/dotfiles"
"code.dumpstack.io/tools/out-of-tree/distro"
"github.com/alecthomas/kong"
@@ -16,11 +18,6 @@ import (
"github.com/naoina/toml"
)
type DockerCommand struct {
Distro distro.Distro
Command string
}
type OutOfTree struct {
// Directory for all files if not explicitly specified
Directory string
@@ -31,16 +28,16 @@ type OutOfTree struct {
Database string
Qemu struct {
Timeout Duration
Timeout artifact.Duration
}
Docker struct {
Timeout Duration
Timeout artifact.Duration
Registry string
// Commands that will be executed before
// the base layer of Dockerfile
Commands []DockerCommand
Commands []distro.Command
}
}
@@ -82,21 +79,21 @@ func ReadOutOfTreeConf(path string) (c OutOfTree, err error) {
}
if c.Directory != "" {
Directory = c.Directory
dotfiles.Directory = c.Directory
} else {
c.Directory = Dir("")
c.Directory = dotfiles.Dir("")
}
if c.Kernels == "" {
c.Kernels = File("kernels.toml")
c.Kernels = dotfiles.File("kernels.toml")
}
if c.UserKernels == "" {
c.UserKernels = File("kernels.user.toml")
c.UserKernels = dotfiles.File("kernels.user.toml")
}
if c.Database == "" {
c.Database = File("db.sqlite")
c.Database = dotfiles.File("db.sqlite")
}
if c.Qemu.Timeout.Duration == 0 {