wisski-cloud-distillery/internal/wisski/ingredient/barrel/stack.go
Tom 588cb7ebaa stack: Do not use templates for env files
This commit removes the templating logic for writing .env files.
Instead it simply writes a key-value directory directly to the destined
file.
2023-07-14 14:06:10 +02:00

40 lines
1 KiB
Go

package barrel
import (
"embed"
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
//go:embed all:barrel
var barrelResources embed.FS
// Barrel returns a stack representing the running WissKI Instance
func (barrel *Barrel) Stack() component.StackWithResources {
return component.StackWithResources{
Stack: component.Stack{
Dir: barrel.FilesystemBase,
},
Resources: barrelResources,
ContextPath: filepath.Join("barrel"),
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": barrel.Malt.Config.Docker.Network(),
"SLUG": barrel.Slug,
"HOST_RULE": barrel.HostRule(),
"WISSKI_HOSTNAME": barrel.Hostname(),
"HTTPS_ENABLED": barrel.Malt.Config.HTTP.HTTPSEnabledEnv(),
"DATA_PATH": filepath.Join(barrel.FilesystemBase, "data"),
"RUNTIME_DIR": barrel.Malt.Config.Paths.RuntimeDir(),
"BARREL_BASE_IMAGE": barrel.GetDockerBaseImage(),
"OPCACHE_MODE": barrel.OpCacheMode(),
},
MakeDirs: []string{"data", ".composer"},
}
}