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

@ -2,13 +2,14 @@ package binder
import (
"bytes"
"embed"
"io"
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/tkw1536/pkglib/yamlx"
"gopkg.in/yaml.v3"
_ "embed"
)
type Binder struct {
@ -66,13 +67,8 @@ func (binder *Binder) buildYML() ([]byte, error) {
return yaml.Marshal(dockerCompose)
}
//go:embed binder.env
var resources embed.FS
func (binder *Binder) Stack() component.StackWithResources {
return component.MakeStack(binder, component.StackWithResources{
Resources: resources,
EnvPath: "binder.env",
ReadComposeFile: func() (io.Reader, error) {
data, err := binder.buildYML()
if err != nil {