wdcli: Use progress writer instead of IOStream
This commit is contained in:
parent
890022ae64
commit
3b78b06fff
49 changed files with 396 additions and 393 deletions
|
|
@ -3,6 +3,7 @@ package provisioner
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
|
|
@ -20,10 +21,10 @@ type Provisioner struct {
|
|||
}
|
||||
|
||||
// Provision provisions an instance, assuming that the required databases already exist.
|
||||
func (provision *Provisioner) Provision(ctx context.Context, io stream.IOStream) error {
|
||||
func (provision *Provisioner) Provision(ctx context.Context, progress io.Writer) error {
|
||||
|
||||
// build the container
|
||||
if err := provision.Barrel.Build(ctx, io, false); err != nil {
|
||||
if err := provision.Barrel.Build(ctx, progress, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +55,7 @@ func (provision *Provisioner) Provision(ctx context.Context, io stream.IOStream)
|
|||
// TODO: Move the provision script into the control plane!
|
||||
provisionScript := "sudo PATH=$PATH -u www-data /bin/bash /provision_container.sh " + strings.Join(provisionParams, " ")
|
||||
|
||||
code, err := provision.Barrel.Stack().Run(ctx, io, true, "barrel", "/bin/bash", "-c", provisionScript)
|
||||
code, err := provision.Barrel.Stack().Run(ctx, stream.NonInteractive(progress), true, "barrel", "/bin/bash", "-c", provisionScript)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue