wisski-cloud-distillery/internal/wisski/ingredient/reserve/reserve.go
Tom Wiesing 945329a080
Move to yaml-based configuration
This commit updates the configuration to be yaml-based and updates the
configuration to read in a yaml file.
2023-02-25 09:14:56 +01:00

40 lines
1 KiB
Go

package reserve
import (
"embed"
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
)
// Reserve implements reserving a WissKI Instance
// TODO: This should be integrated into the bookkeeping table.
type Reserve struct {
ingredient.Base
}
//go:embed all:reserve reserve.env
var reserveResources embed.FS
// Stack returns a stack representing the reserve instance
func (reserve *Reserve) Stack() component.StackWithResources {
return component.StackWithResources{
Stack: component.Stack{
Dir: reserve.FilesystemBase,
Env: reserve.Malt.Environment,
},
Resources: reserveResources,
ContextPath: filepath.Join("reserve"),
EnvPath: filepath.Join("reserve.env"),
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": reserve.Malt.Config.Docker.Network,
"SLUG": reserve.Slug,
"VIRTUAL_HOST": reserve.Domain(),
"HTTPS_ENABLED": reserve.Malt.Config.HTTP.HTTPSEnabledEnv(),
},
}
}