Split up WissKI Instance code

This commit is contained in:
Tom Wiesing 2022-09-15 12:54:16 +02:00
parent d7110dd63c
commit 85b5603d9d
No known key found for this signature in database
16 changed files with 285 additions and 244 deletions

View file

@ -107,7 +107,7 @@ func (p provision) Run(context wisski_distillery.Context) error {
// start the container!
logging.LogMessage(context.IOStream, "Starting Container")
if err := instance.Stack().Up(context.IOStream); err != nil {
if err := instance.Barrel().Up(context.IOStream); err != nil {
return err
}

View file

@ -67,7 +67,7 @@ func (p purge) Run(context wisski_distillery.Context) error {
// remove docker stack
logging.LogMessage(context.IOStream, "Stopping and removing docker container")
if err := instance.Stack().Down(context.IOStream); err != nil {
if err := instance.Barrel().Down(context.IOStream); err != nil {
context.EPrintln(err)
}

View file

@ -42,7 +42,7 @@ func (rb rebuild) Run(context wisski_distillery.Context) error {
var globalErr error
for _, instance := range instances {
logging.LogOperation(func() error {
s := instance.Stack()
s := instance.Barrel()
if err := logging.LogOperation(func() error {
return s.Install(context.IOStream, component.InstallationContext{})
}, context.IOStream, "Installing docker stack"); err != nil {

View file

@ -63,7 +63,7 @@ func (r reserve) Run(context wisski_distillery.Context) error {
}
// setup docker stack
s := instance.ReserveStack()
s := instance.Reserve()
{
if err := logging.LogOperation(func() error {
return s.Install(context.IOStream, component.InstallationContext{})