wisski-cloud-distillery/env/stack.go
Tom Wiesing 5d906169f4
internal/stack: Cleanup API
This commit cleans up the internal stack API to prepare it for an
eventual move to using a native docker client.
2022-09-08 14:39:04 +02:00

30 lines
811 B
Go

package env
import (
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/stack"
)
// Stacks returns the Stacks of this distillery
func (dis *Distillery) Stacks() []stack.Installable {
// TODO: Do we want to cache these stacks?
return []stack.Installable{
dis.WebStack(),
dis.SelfStack(),
dis.ResolverStack(),
dis.SSHStack(),
dis.TriplestoreStack(),
dis.SQLStack(),
}
}
// asCoreStack treats the provided stack as a core component of this distillery.
func (dis *Distillery) asCoreStack(name string, stack stack.Installable) stack.Installable {
stack.Dir = filepath.Join(dis.Config.DeployRoot, "core", name)
stack.ContextResource = filepath.Join("resources", "compose", name)
stack.EnvFileResource = filepath.Join("resources", "templates", "docker-env", name)
return stack
}