Documentation
¶
Index ¶
Constants ¶
View Source
const ( INSTANCES_FLAG = "instances" STEP_DELAY_FLAG = "stepdel" RESUME_FLAG = "resume" LB_FLAG = "lb" LB_TIMEOUT_FLAG = "lb-timeout" BG_DRYRUN_FLAG = "dry" )
View Source
const ( HOST_FLAG = "host" SCALE_FLAG = "scale" FORMAT_FLAG = "format" TEMPLATE_CTX_FLAG = "tempctx" DEFAULT_CTX = "template-context.json" STOP_DEPLOYS_FLAG = "stop-deploys" )
View Source
const ( STDERR_FLAG = "stderr" FOLLOW_FLAG = "follow" POLL_FLAG = "poll" )
View Source
const ( WAIT_FLAG string = "wait" TIMEOUT_FLAG string = "wait-timeout" FORCE_FLAG string = "force" DETAIL_FLAG string = "detail" PARAMS_FLAG string = "param" ENV_FILE_FLAG string = "env-file" IGNORE_MISSING string = "ignore" INSECURE_FLAG string = "insecure" ENV_NAME string = "env_name" )
View Source
const ( T_APPLICATIONS = `` /* 277-byte string literal not displayed */ T_APPLICATION = `` /* 858-byte string literal not displayed */ T_VERSIONS = ` {{ "VERSIONS" }} {{ range .Versions }}{{ . }} {{end}}` T_DEPLOYMENT_ID = ` {{ "DEPLOYMENT_ID" }} {{ "VERSION" }} {{ .DeploymentID }} {{ .Version }}` T_TASKS = `` /* 172-byte string literal not displayed */ T_TASK = `` /* 199-byte string literal not displayed */ T_DEPLOYMENTS = `` /* 217-byte string literal not displayed */ T_LEADER_INFO = ` {{ "Leader:" }} {{ .Leader }} ` T_PING = ` {{ "HOST" }} {{ "DURATION" }} {{ .Host }} {{ .Elapsed | msDur }} ` T_MARATHON_INFO = `` /* 862-byte string literal not displayed */ T_QUEUED_TASKS = `` /* 139-byte string literal not displayed */ T_MESSAGE = ` {{ "Message:" }} {{ .Message }} ` T_GROUPS = `` /* 168-byte string literal not displayed */ )
View Source
const (
DefaultEnv = "-"
)
Variables ¶
View Source
var Funcs = template.FuncMap{ "default": func(args ...interface{}) interface{} { arg := args[0] if len(args) < 2 { return arg } value := args[1] defer recovery() v := reflect.ValueOf(value) switch v.Kind() { case reflect.String, reflect.Slice, reflect.Array, reflect.Map: if v.Len() == 0 { return arg } case reflect.Bool: if !v.Bool() { return arg } default: return value } return value }, "isEnv": func(value string) bool { if len(value) > 0 { current := strings.ToLower(viper.GetString(ENV_NAME)) return current == strings.ToLower(value) } return false }, }
Templated based Functions
Functions ¶
func AddJailedMarathonToCmd ¶
func AddJailedMarathonToCmd(rc *cobra.Command, c *cliconfig.ConfigFile)
Jails (chroots) marathon by including only it's sub commands when we only have a single environment declared and already know the cluster type
func AddMarathonToCmd ¶
func AddMarathonToCmd(rc *cobra.Command, c *cliconfig.ConfigFile)
Associates the marathon service to the given command
func TemplateExists ¶ added in v0.9.0
Types ¶
type TemplateContext ¶ added in v0.8.9
type TemplateContext struct {
Environments map[string]*TemplateEnvironment `json:"environments,omitempty"`
}
func LoadTemplateContext ¶ added in v0.8.9
func LoadTemplateContext(filename string) (*TemplateContext, error)
type TemplateEnvironment ¶ added in v0.8.9
Click to show internal directories.
Click to hide internal directories.