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.
This commit is contained in:
Tom 2023-07-14 14:04:38 +02:00
parent 46b16e5700
commit 588cb7ebaa
22 changed files with 180 additions and 121 deletions

View file

@ -7,7 +7,7 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
//go:embed all:barrel barrel.env
//go:embed all:barrel
var barrelResources embed.FS
// Barrel returns a stack representing the running WissKI Instance
@ -19,15 +19,14 @@ func (barrel *Barrel) Stack() component.StackWithResources {
Resources: barrelResources,
ContextPath: filepath.Join("barrel"),
EnvPath: filepath.Join("barrel.env"),
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": barrel.Malt.Config.Docker.Network(),
"SLUG": barrel.Slug,
"HOST_RULE": barrel.HostRule(),
"HOSTNAME": barrel.Hostname(),
"HTTPS_ENABLED": barrel.Malt.Config.HTTP.HTTPSEnabledEnv(),
"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(),