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:
parent
11571fd6ea
commit
8c16fbb8aa
15 changed files with 691 additions and 0 deletions
36
pkg/libstack/libstack.go
Normal file
36
pkg/libstack/libstack.go
Normal 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 ``
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue