1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 691 additions and 0 deletions

36
pkg/libstack/libstack.go Normal file
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 ``
}