Add a metadata system
This commit is contained in:
parent
07409a01be
commit
8b3218ad00
16 changed files with 365 additions and 61 deletions
|
|
@ -114,6 +114,11 @@ func (p purge) Run(context wisski_distillery.Context) error {
|
|||
context.EPrintln(err)
|
||||
}
|
||||
|
||||
logging.LogMessage(context.IOStream, "Purging instance metadata")
|
||||
if err := instance.Metadata().Purge(); err != nil {
|
||||
context.EPrintln(err)
|
||||
}
|
||||
|
||||
logging.LogMessage(context.IOStream, "Instance %s has been purged", slug)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package cmd
|
|||
|
||||
import (
|
||||
wisski_distillery "github.com/FAU-CDI/wisski-distillery"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/core"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
|
|
@ -44,22 +43,7 @@ func (rb rebuild) Run(context wisski_distillery.Context) error {
|
|||
var globalErr error
|
||||
for _, instance := range instances {
|
||||
logging.LogOperation(func() error {
|
||||
s := instance.Barrel()
|
||||
if err := logging.LogOperation(func() error {
|
||||
return s.Install(dis.Core.Environment, context.IOStream, component.InstallationContext{})
|
||||
}, context.IOStream, "Installing docker stack"); err != nil {
|
||||
globalErr = err
|
||||
return err
|
||||
}
|
||||
|
||||
if err := logging.LogOperation(func() error {
|
||||
return s.Update(context.IOStream, true)
|
||||
}, context.IOStream, "Updating docker stack"); err != nil {
|
||||
globalErr = err
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return instance.Build(context.IOStream, true)
|
||||
}, context.IOStream, "Rebuilding instance %s", instance.Slug)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ func (r reserve) Run(context wisski_distillery.Context) error {
|
|||
s := instance.Reserve()
|
||||
{
|
||||
if err := logging.LogOperation(func() error {
|
||||
return s.Install(dis.Core.Environment, context.IOStream, component.InstallationContext{})
|
||||
return s.Install(context.IOStream, component.InstallationContext{})
|
||||
}, context.IOStream, "Installing docker stack"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ func (si systemupdate) Run(context wisski_distillery.Context) error {
|
|||
ctx := component.Context(ctx)
|
||||
|
||||
if err := logging.LogOperation(func() error {
|
||||
return stack.Install(dis.Core.Environment, context.IOStream, ctx)
|
||||
return stack.Install(context.IOStream, ctx)
|
||||
}, context.IOStream, "Installing Docker Stack %q", name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue