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

47 lines
891 B
Go

package solr
import (
"embed"
"path/filepath"
"time"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
type Solr struct {
component.Base
BaseURL string // upstream solr url
PollInterval time.Duration // duration to wait for during wait
}
var (
_ component.Installable = (*Solr)(nil)
)
func (s *Solr) Path() string {
return filepath.Join(s.Still.Config.Paths.Root, "core", "solr")
}
func (*Solr) Context(parent component.InstallationContext) component.InstallationContext {
return parent
}
//go:embed all:solr
var resources embed.FS
func (solr *Solr) Stack() component.StackWithResources {
return component.MakeStack(solr, component.StackWithResources{
Resources: resources,
ContextPath: "solr",
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": solr.Config.Docker.Network(),
},
MakeDirs: []string{
filepath.Join("data"),
},
})
}