wisski-cloud-distillery/internal/dis/component/ssh2/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

42 lines
1.1 KiB
Go

package ssh2
import (
"embed"
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/bootstrap"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
func (ssh *SSH2) Path() string {
return filepath.Join(ssh.Still.Config.Paths.Root, "core", "ssh2")
}
//go:embed all:ssh2
var resources embed.FS
func (ssh *SSH2) Stack() component.StackWithResources {
return component.MakeStack(ssh, component.StackWithResources{
Resources: resources,
ContextPath: "ssh2",
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": ssh.Config.Docker.Network(),
"HOST_RULE": ssh.Config.HTTP.DefaultHostRule(),
"CONFIG_PATH": ssh.Config.ConfigPath,
"DEPLOY_ROOT": ssh.Config.Paths.Root,
"SELF_OVERRIDES_FILE": ssh.Config.Paths.OverridesJSON,
"SELF_RESOLVER_BLOCK_FILE": ssh.Config.Paths.ResolverBlocks,
},
CopyContextFiles: []string{bootstrap.Executable},
})
}
func (ssh *SSH2) Context(parent component.InstallationContext) component.InstallationContext {
return component.InstallationContext{
bootstrap.Executable: ssh.Config.Paths.CurrentExecutable(), // TODO: Does this make sense?
}
}