refactor(libstack): move library to portainer [EE-5474] (#9120)

This commit is contained in:
Chaim Lev-Ari
2023-06-26 08:11:05 +07:00
committed by GitHub
parent 11571fd6ea
commit 8c16fbb8aa
15 changed files with 691 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package libstack
import (
"context"
)
type Deployer interface {
Deploy(ctx context.Context, filePaths []string, options DeployOptions) error
// Remove stops and removes containers
//
// projectName or filePaths are required
// if projectName is supplied filePaths will be ignored
Remove(ctx context.Context, projectName string, filePaths []string, options Options) error
Pull(ctx context.Context, filePaths []string, options Options) error
Validate(ctx context.Context, filePaths []string, options Options) error
}
type Options struct {
WorkingDir string
Host string
ProjectName string
// EnvFilePath is the path to a .env file
EnvFilePath string
// Env is a list of environment variables to pass to the command, example: "FOO=bar"
Env []string
}
type DeployOptions struct {
Options
ForceRecreate bool
// AbortOnContainerExit will stop the deployment if a container exits.
// This is useful when running a onetime task.
//
// When this is set, docker compose will output its logs to stdout
AbortOnContainerExit bool ``
}