frontend: Add instance update functionality
This commit is contained in:
parent
ccab2883a6
commit
45af2cc95b
6 changed files with 119 additions and 70 deletions
|
|
@ -6,7 +6,6 @@ import (
|
|||
wisski_distillery "github.com/FAU-CDI/wisski-distillery"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/component/instances"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/core"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
"github.com/tkw1536/goprogram/lib/collection"
|
||||
"github.com/tkw1536/goprogram/status"
|
||||
|
|
@ -52,15 +51,8 @@ func (bu blindUpdate) Run(context wisski_distillery.Context) error {
|
|||
}
|
||||
|
||||
// and do the actual blind_update!
|
||||
return status.StreamGroup(context.IOStream, bu.Parallel, func(instance instances.WissKI, io stream.IOStream) error {
|
||||
code, err := instance.Shell(io, "/runtime/blind_update.sh")
|
||||
if err != nil {
|
||||
return errBlindUpdateFailed.WithMessageF(instance.Slug, environment.ExecCommandError)
|
||||
}
|
||||
if code != 0 {
|
||||
return errBlindUpdateFailed.WithMessageF(instance.Slug, code)
|
||||
}
|
||||
return nil
|
||||
return status.StreamGroup(context.IOStream, bu.Parallel, func(instance instances.WissKI, str stream.IOStream) error {
|
||||
return instance.BlindUpdate(str)
|
||||
}, wissKIs, status.SmartMessage(func(item instances.WissKI) string {
|
||||
return fmt.Sprintf("blind_update %q", item.Slug)
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ func (i info) Run(context wisski_distillery.Context) error {
|
|||
context.Printf("Running: %v\n", info.Running)
|
||||
context.Printf("Locked: %v\n", info.Locked)
|
||||
context.Printf("Last Rebuild: %v\n", info.LastRebuild.String())
|
||||
context.Printf("Last Update: %v\n", info.LastUpdate.String())
|
||||
|
||||
context.Printf("Skip Prefixes: %v\n", info.NoPrefixes)
|
||||
context.Printf("Prefixes: (count %d)\n", len(info.Prefixes))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue