deployments

package
v0.0.0-...-4560a53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnpackerCmdDeploy        = "deploy"
	UnpackerCmdUndeploy      = "undeploy"
	UnpackerCmdSwarmDeploy   = "swarm-deploy"
	UnpackerCmdSwarmUndeploy = "swarm-undeploy"
)

Variables

This section is empty.

Functions

func NewStackDeployer

func NewStackDeployer(swarmStackManager portainer.SwarmStackManager, composeStackManager portainer.ComposeStackManager,
	kubernetesDeployer portainer.KubernetesDeployer, clientFactory *dockerclient.ClientFactory, dataStore dataservices.DataStore) *stackDeployer

NewStackDeployer inits a stackDeployer struct with a SwarmStackManager, a ComposeStackManager and a KubernetesDeployer

func RedeployWhenChanged

func RedeployWhenChanged(stackID portainer.StackID, deployer StackDeployer, datastore dataservices.DataStore, gitService portainer.GitService) error

RedeployWhenChanged pull and redeploy the stack when git repo changed Stack will always be redeployed if force deployment is set to true

func StartAutoupdate

func StartAutoupdate(stackID portainer.StackID, interval string, scheduler *scheduler.Scheduler, stackDeployer StackDeployer, datastore dataservices.DataStore, gitService portainer.GitService) (jobID string, e *httperror.HandlerError)

func StartStackSchedules

func StartStackSchedules(scheduler *scheduler.Scheduler, stackdeployer StackDeployer, datastore dataservices.DataStore, gitService portainer.GitService) error

func StopAutoupdate

func StopAutoupdate(stackID portainer.StackID, jobID string, scheduler *scheduler.Scheduler)

Types

type BaseStackDeployer

type BaseStackDeployer interface {
	DeploySwarmStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry, prune bool, pullImage bool) error
	DeployComposeStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry, forcePullImage bool, forceRecreate bool) error
	DeployKubernetesStack(stack *portainer.Stack, endpoint *portainer.Endpoint, user *portainer.User) error
}

type ComposeStackDeploymentConfig

type ComposeStackDeploymentConfig struct {
	ForceCreate   bool
	FileService   portainer.FileService
	StackDeployer StackDeployer
	// contains filtered or unexported fields
}

func CreateComposeStackDeploymentConfig

func CreateComposeStackDeploymentConfig(securityContext *security.RestrictedRequestContext, stack *portainer.Stack, endpoint *portainer.Endpoint, dataStore dataservices.DataStore, fileService portainer.FileService, deployer StackDeployer, forcePullImage, forceCreate bool) (*ComposeStackDeploymentConfig, error)

func (*ComposeStackDeploymentConfig) Deploy

func (config *ComposeStackDeploymentConfig) Deploy() error

func (*ComposeStackDeploymentConfig) GetResponse

func (config *ComposeStackDeploymentConfig) GetResponse() string

func (*ComposeStackDeploymentConfig) GetUsername

func (config *ComposeStackDeploymentConfig) GetUsername() string

type KubernetesStackDeploymentConfig

type KubernetesStackDeploymentConfig struct {
	// contains filtered or unexported fields
}

func CreateKubernetesStackDeploymentConfig

func CreateKubernetesStackDeploymentConfig(stack *portainer.Stack, kubeDeployer portainer.KubernetesDeployer, appLabels k.KubeAppLabels, user *portainer.User, endpoint *portainer.Endpoint) (*KubernetesStackDeploymentConfig, error)

func (*KubernetesStackDeploymentConfig) Deploy

func (config *KubernetesStackDeploymentConfig) Deploy() error

func (*KubernetesStackDeploymentConfig) GetResponse

func (config *KubernetesStackDeploymentConfig) GetResponse() string

func (*KubernetesStackDeploymentConfig) GetUsername

func (config *KubernetesStackDeploymentConfig) GetUsername() string

type RemoteStackDeployer

type RemoteStackDeployer interface {
	// compose
	DeployRemoteComposeStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry, forcePullImage bool, forceRecreate bool) error
	UndeployRemoteComposeStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error
	StartRemoteComposeStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry) error
	StopRemoteComposeStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error
	// swarm
	DeployRemoteSwarmStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry, prune bool, pullImage bool) error
	UndeployRemoteSwarmStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error
	StartRemoteSwarmStack(stack *portainer.Stack, endpoint *portainer.Endpoint, registries []portainer.Registry) error
	StopRemoteSwarmStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error
}

type StackAuthorMissingErr

type StackAuthorMissingErr struct {
	// contains filtered or unexported fields
}

func (*StackAuthorMissingErr) Error

func (e *StackAuthorMissingErr) Error() string

type StackDeployer

type StackDeployer interface {
	BaseStackDeployer
	RemoteStackDeployer
}

type StackDeploymentConfiger

type StackDeploymentConfiger interface {
	GetUsername() string
	Deploy() error
	GetResponse() string
}

type StackRemoteOperation

type StackRemoteOperation string
const (
	OperationDeploy        StackRemoteOperation = "compose-deploy"
	OperationUndeploy      StackRemoteOperation = "compose-undeploy"
	OperationComposeStart  StackRemoteOperation = "compose-start"
	OperationComposeStop   StackRemoteOperation = "compose-stop"
	OperationSwarmDeploy   StackRemoteOperation = "swarm-deploy"
	OperationSwarmUndeploy StackRemoteOperation = "swarm-undeploy"
	OperationSwarmStart    StackRemoteOperation = "swarm-start"
	OperationSwarmStop     StackRemoteOperation = "swarm-stop"
)

type SwarmStackDeploymentConfig

type SwarmStackDeploymentConfig struct {
	FileService   portainer.FileService
	StackDeployer StackDeployer
	// contains filtered or unexported fields
}

func CreateSwarmStackDeploymentConfig

func CreateSwarmStackDeploymentConfig(securityContext *security.RestrictedRequestContext, stack *portainer.Stack, endpoint *portainer.Endpoint, dataStore dataservices.DataStore, fileService portainer.FileService, deployer StackDeployer, prune bool, pullImage bool) (*SwarmStackDeploymentConfig, error)

func (*SwarmStackDeploymentConfig) Deploy

func (config *SwarmStackDeploymentConfig) Deploy() error

func (*SwarmStackDeploymentConfig) GetResponse

func (config *SwarmStackDeploymentConfig) GetResponse() string

func (*SwarmStackDeploymentConfig) GetUsername

func (config *SwarmStackDeploymentConfig) GetUsername() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL