Documentation ¶
Index ¶
- Constants
- Variables
- func DontSkipValidation(opts *loader.Options)
- func GetStackServices(ctx context.Context, dockerclient client.APIClient, namespace string) ([]swarm.Service, error)
- func GetStacks(cl *dockerClient.Client) ([]*formatter.Stack, error)
- func IsDeployed(ctx context.Context, cl *dockerClient.Client, stackName string) (bool, string, error)
- func LoadComposefile(opts Deploy, appEnv map[string]string, options ...func(*loader.Options)) (*composetypes.Config, error)
- func RunDeploy(cl *dockerClient.Client, opts Deploy, cfg *composetypes.Config, appName string, ...) error
- func RunRemove(ctx context.Context, client *apiclient.Client, opts Remove) error
- func SkipInterpolation(opts *loader.Options)
- func WaitOnService(ctx context.Context, cl *dockerClient.Client, serviceID, appName string) error
- type Deploy
- type Remove
- type StackStatus
- func GetAllDeployedServices(cl *dockerClient.Client, contextName string) StackStatus
- func GetDeployedServicesByLabel(cl *dockerClient.Client, contextName string, label string) StackStatus
- func GetDeployedServicesByName(ctx context.Context, cl *dockerClient.Client, stackName, serviceName string) StackStatus
Constants ¶
const ( ResolveImageAlways = "always" ResolveImageChanged = "changed" ResolveImageNever = "never" )
Resolve image constants
Variables ¶
var WaitTimeout int = 50
Timeout to wait until docker services converge, default is 50s (random choice)
Functions ¶
func DontSkipValidation ¶
DontSkipValidation ensures validation is done for compose file loading
func GetStackServices ¶
func GetStacks ¶
func GetStacks(cl *dockerClient.Client) ([]*formatter.Stack, error)
Copypasta from https://github.com/docker/cli/blob/master/cli/command/stack/swarm/list.go GetStacks lists the swarm stacks.
func IsDeployed ¶
func IsDeployed(ctx context.Context, cl *dockerClient.Client, stackName string) (bool, string, error)
IsDeployed chekcks whether an appp is deployed or not.
func LoadComposefile ¶
func LoadComposefile(opts Deploy, appEnv map[string]string, options ...func(*loader.Options)) (*composetypes.Config, error)
LoadComposefile parse the composefile specified in the cli and returns its Config and version.
func RunDeploy ¶
func RunDeploy(cl *dockerClient.Client, opts Deploy, cfg *composetypes.Config, appName string, dontWait bool) error
RunDeploy is the swarm implementation of docker stack deploy
func SkipInterpolation ¶
SkipInterpolation skip interpolating environment variables.
Types ¶
type Deploy ¶
type Deploy struct { Composefiles []string Namespace string ResolveImage string SendRegistryAuth bool Prune bool }
Deploy holds docker stack deploy options
type StackStatus ¶
func GetAllDeployedServices ¶
func GetAllDeployedServices(cl *dockerClient.Client, contextName string) StackStatus
func GetDeployedServicesByLabel ¶
func GetDeployedServicesByLabel(cl *dockerClient.Client, contextName string, label string) StackStatus
GetDeployedServicesByLabel filters services by label
func GetDeployedServicesByName ¶
func GetDeployedServicesByName(ctx context.Context, cl *dockerClient.Client, stackName, serviceName string) StackStatus
GetDeployedServicesByName filters services by name