mv 'env/stack{,_*}.go' => 'env/component{,_*}.go'
This commit is contained in:
parent
09431c4869
commit
54747e267e
7 changed files with 0 additions and 0 deletions
38
env/component_self.go
vendored
Normal file
38
env/component_self.go
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package env
|
||||
|
||||
import "github.com/FAU-CDI/wisski-distillery/internal/stack"
|
||||
|
||||
// SelfComponent represents the 'self' layer belonging to a distillery
|
||||
type SelfComponent struct {
|
||||
dis *Distillery
|
||||
}
|
||||
|
||||
// Self returns the SelfComponent belonging to this distillery
|
||||
func (dis *Distillery) Self() SelfComponent {
|
||||
return SelfComponent{dis: dis}
|
||||
}
|
||||
|
||||
func (SelfComponent) Name() string {
|
||||
return "self"
|
||||
}
|
||||
|
||||
func (sc SelfComponent) Stack() stack.Installable {
|
||||
TARGET := "https://github.com/FAU-CDI/wisski-distillery"
|
||||
if sc.dis.Config.SelfRedirect != nil {
|
||||
TARGET = sc.dis.Config.SelfRedirect.String()
|
||||
}
|
||||
|
||||
return sc.dis.makeComponentStack(sc, stack.Installable{
|
||||
EnvFileContext: map[string]string{
|
||||
"VIRTUAL_HOST": sc.dis.DefaultVirtualHost(),
|
||||
"LETSENCRYPT_HOST": sc.dis.DefaultLetsencryptHost(),
|
||||
"LETSENCRYPT_EMAIL": sc.dis.Config.CertbotEmail,
|
||||
"TARGET": TARGET,
|
||||
"OVERRIDES_FILE": sc.dis.Config.SelfOverridesFile,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func (sc SelfComponent) Path() string {
|
||||
return sc.Stack().Dir
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue