Documentation ¶
Index ¶
- func CheckEnv(app App) ([]envfile.EnvVar, error)
- func ExposeAllEnv(stackName string, compose *composetypes.Config, appEnv envfile.AppEnv)
- func GetAppComposeConfig(recipe string, opts stack.Deploy, appEnv envfile.AppEnv) (*composetypes.Config, error)
- func GetAppNames() ([]string, error)
- func GetAppServiceNames(appName string) ([]string, error)
- func GetAppStatuses(apps []App, MachineReadable bool) (map[string]map[string]string, error)
- func GetLabel(compose *composetypes.Config, stackName string, label string) string
- func GetTimeoutFromLabel(compose *composetypes.Config, stackName string) (int, error)
- func ReadAbraShCmdNames(abraSh string) ([]string, error)
- func SanitiseAppName(name string) string
- func ServiceFilter(stack, service string, exact bool) string
- func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool)
- func SetChaosVersionLabel(compose *composetypes.Config, stackName string, chaosVersion string)
- func SetRecipeLabel(compose *composetypes.Config, stackName string, recipe string)
- func SetUpdateLabel(compose *composetypes.Config, stackName string, appEnv envfile.AppEnv)
- func StackName(appName string) string
- func TemplateAppEnvSample(r recipe.Recipe, appName, server, domain string) error
- type App
- type AppFile
- type AppFiles
- type AppName
- type ByName
- type ByRecipe
- type ByServer
- type ByServerAndRecipe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExposeAllEnv ¶
func ExposeAllEnv(stackName string, compose *composetypes.Config, appEnv envfile.AppEnv)
ExposeAllEnv exposes all env variables to the app container
func GetAppComposeConfig ¶
func GetAppComposeConfig(recipe string, opts stack.Deploy, appEnv envfile.AppEnv) (*composetypes.Config, error)
GetAppComposeConfig retrieves a compose specification for a recipe. This specification is the result of a merge of all the compose.**.yml files in the recipe repository.
func GetAppServiceNames ¶
GetAppServiceNames retrieves a list of app service names.
func GetAppStatuses ¶
GetAppStatuses queries servers to check the deployment status of given apps.
func GetLabel ¶
func GetLabel(compose *composetypes.Config, stackName string, label string) string
GetLabel reads docker labels in the format of "coop-cloud.${STACK_NAME}.${LABEL}" from the local compose files
func GetTimeoutFromLabel ¶
func GetTimeoutFromLabel(compose *composetypes.Config, stackName string) (int, error)
GetTimeoutFromLabel reads the timeout value from docker label "coop-cloud.${STACK_NAME}.TIMEOUT" and returns 50 as default value
func ReadAbraShCmdNames ¶
ReadAbraShCmdNames reads the names of commands.
func SanitiseAppName ¶
SanitiseAppName makes a app name usable with Docker by replacing illegal characters.
func ServiceFilter ¶
ServiceFilter creates a filter string for filtering a service in the docker container runtime. When exact match is true, it uses regex to match the string exactly.
func SetChaosLabel ¶
func SetChaosLabel(compose *composetypes.Config, stackName string, chaos bool)
SetChaosLabel adds the label 'coop-cloud.${STACK_NAME}.chaos=true/false' to the app container to signal if the app is deployed in chaos mode
func SetChaosVersionLabel ¶
func SetChaosVersionLabel(compose *composetypes.Config, stackName string, chaosVersion string)
SetChaosVersionLabel adds the label 'coop-cloud.${STACK_NAME}.chaos-version=$(GIT_COMMIT)' to the app container
func SetRecipeLabel ¶
func SetRecipeLabel(compose *composetypes.Config, stackName string, recipe string)
SetRecipeLabel adds the label 'coop-cloud.${STACK_NAME}.recipe=${RECIPE}' to the app container to signal which recipe is connected to the deployed app
func SetUpdateLabel ¶
func SetUpdateLabel(compose *composetypes.Config, stackName string, appEnv envfile.AppEnv)
SetUpdateLabel adds env ENABLE_AUTO_UPDATE as label to enable/disable the auto update process for this app. The default if this variable is not set is to disable the auto update process.
Types ¶
type App ¶
type App struct { Name AppName Recipe recipe.Recipe Domain string Env envfile.AppEnv Server string Path string }
App reprents an app with its env file read into memory
func GetApp ¶
GetApp loads an apps settings, reading it from file, in preparation to use it. It should only be used when ready to use the env file to keep IO operations down.
func GetApps ¶
GetApps returns a slice of Apps with their env files read from a given slice of AppFiles.
func (App) Filters ¶
Filters retrieves app filters for querying the container runtime. By default it filters on all services in the app. It is also possible to pass an otional list of service names, which get filtered instead.
Due to upstream issues, filtering works different depending on what you're querying. So, for example, secrets don't work with regex! The caller needs to implement their own validation that the right secrets are matched. In order to handle these cases, we provide the `appendServiceNames` / `exactMatch` modifiers.
type AppFiles ¶
AppFiles is a slice of appfiles
func LoadAppFiles ¶
LoadAppFiles gets all app files for a given set of servers or all servers.
type ByServerAndRecipe ¶
type ByServerAndRecipe []App
ByServerAndRecipe sort a slice of Apps
func (ByServerAndRecipe) Len ¶
func (a ByServerAndRecipe) Len() int
func (ByServerAndRecipe) Less ¶
func (a ByServerAndRecipe) Less(i, j int) bool
func (ByServerAndRecipe) Swap ¶
func (a ByServerAndRecipe) Swap(i, j int)