Add cron tasks to distillery
This commit is contained in:
parent
790460f9de
commit
f52fe6abf3
19 changed files with 353 additions and 141 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
|
|
@ -29,6 +30,19 @@ type Stack struct {
|
|||
DockerExecutable string // Path to the native docker executable to use
|
||||
}
|
||||
|
||||
var errStackKill = errors.New("Stack.Kill: Kill returned non-zero exit code")
|
||||
|
||||
func (ds Stack) Kill(ctx context.Context, progress io.Writer, service string, signal os.Signal) error {
|
||||
code, err := ds.compose(ctx, stream.NonInteractive(progress), "kill", service, "-s", signal.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if code != 0 {
|
||||
return errStackKill
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var errStackUpdatePull = errors.New("Stack.Update: Pull returned non-zero exit code")
|
||||
var errStackUpdateBuild = errors.New("Stack.Update: Build returned non-zero exit code")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue