internal/component: Cleanup unused general code

This commit is contained in:
Tom Wiesing 2022-09-21 12:00:36 +02:00
parent a5d9b1a386
commit 84974dd712
No known key found for this signature in database
12 changed files with 127 additions and 92 deletions

View file

@ -9,6 +9,10 @@ import (
type Installable interface {
Component
// Path returns the path this component is installed at.
// By convention it is /var/www/deploy/internal/core/${Name()}
Path() string
// Stack can be used to gain access to the "docker compose" stack.
//
// This should internally call [ComponentBase.MakeStack]
@ -19,6 +23,13 @@ type Installable interface {
Context(parent InstallationContext) InstallationContext
}
// MakeStack registers the Installable as a stack
func MakeStack(component Installable, env environment.Environment, stack StackWithResources) StackWithResources {
stack.Env = env
stack.Dir = component.Path()
return stack
}
// Updatable represents a component with an Update method.
type Updatable interface {
Component