Update to goprogram 0.1.0
This commit is contained in:
parent
d2d681a4f2
commit
7cda92b342
31 changed files with 141 additions and 244 deletions
|
|
@ -7,9 +7,9 @@ import (
|
|||
"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/FAU-CDI/wisski-distillery/pkg/slicesx"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/smartp"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
"github.com/tkw1536/goprogram/lib/collection"
|
||||
"github.com/tkw1536/goprogram/status"
|
||||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
|
|
@ -46,13 +46,13 @@ func (bu blindUpdate) Run(context wisski_distillery.Context) error {
|
|||
return err
|
||||
}
|
||||
if !bu.Force {
|
||||
wissKIs = slicesx.Filter(wissKIs, func(instance instances.WissKI) bool {
|
||||
wissKIs = collection.Filter(wissKIs, func(instance instances.WissKI) bool {
|
||||
return bool(instance.AutoBlindUpdateEnabled)
|
||||
})
|
||||
}
|
||||
|
||||
// and do the actual blind_update!
|
||||
return smartp.Run(context.IOStream, bu.Parallel, func(instance instances.WissKI, io stream.IOStream) error {
|
||||
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)
|
||||
|
|
@ -61,7 +61,7 @@ func (bu blindUpdate) Run(context wisski_distillery.Context) error {
|
|||
return errBlindUpdateFailed.WithMessageF(instance.Slug, code)
|
||||
}
|
||||
return nil
|
||||
}, wissKIs, smartp.SmartMessage(func(item instances.WissKI) string {
|
||||
}, wissKIs, status.SmartMessage(func(item instances.WissKI) string {
|
||||
return fmt.Sprintf("blind_update %q", item.Slug)
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue