本文整理汇总了Golang中github.com/InnovaCo/serve/manifest.Manifest.GetBool方法的典型用法代码示例。如果您正苦于以下问题:Golang Manifest.GetBool方法的具体用法?Golang Manifest.GetBool怎么用?Golang Manifest.GetBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/InnovaCo/serve/manifest.Manifest
的用法示例。
在下文中一共展示了Manifest.GetBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Run
func (p DeployMarathon) Run(data manifest.Manifest) error {
if data.GetBool("purge") {
return p.Uninstall(data)
} else {
return p.Install(data)
}
}
示例2: Run
func (p DBCreatePostgresql) Run(data manifest.Manifest) error {
if data.GetBool("purge") {
return p.Drop(data)
} else {
return p.Create(data)
}
}
示例3: Run
func (p BuildDebian) Run(data manifest.Manifest) error {
env := make(map[string]string)
// required fields
env["MANIFEST_PACKAGE"] = data.GetString("package")
env["MANIFEST_INFO_NAME"] = data.GetString("name")
env["MANIFEST_INFO_VERSION"] = data.GetString("version")
env["MANIFEST_BUILD_DEBIAN_SECTION"] = data.GetString("category")
env["MANIFEST_INFO_CATEGORY"] = data.GetString("category")
env["MANIFEST_BUILD_DEBIAN_MAINTAINER_NAME"] = data.GetString("maintainer-name")
env["MANIFEST_BUILD_DEBIAN_MAINTAINER_EMAIL"] = data.GetString("maintainer-email")
env["MANIFEST_BUILD_DEBIAN_INSTALL_ROOT"] = data.GetString("install-root")
daemon := data.GetString("daemon")
daemonArgs := data.GetString("daemon-args")
if daemon != "" && data.GetBool("consul-supervisor") {
daemonArgs = fmt.Sprintf(
"consul supervisor --service '%s/%s' --port $PORT1 start %s %s",
data.GetString("category"),
data.GetString("package"),
daemon,
daemonArgs,
)
daemon = "/usr/local/bin/serve-tools"
}
// optional fields
env["MANIFEST_BUILD_DEBIAN_DAEMON"] = daemon
env["MANIFEST_BUILD_DEBIAN_DAEMON_ARGS"] = daemonArgs
env["MANIFEST_BUILD_DEBIAN_SERVICE_OWNER"] = data.GetString("service-owner")
env["MANIFEST_BUILD_DEBIAN_DAEMON_USER"] = data.GetString("daemon-user")
env["MANIFEST_BUILD_DEBIAN_DAEMON_PORT"] = data.GetString("daemon-port")
env["MANIFEST_BUILD_DEBIAN_MAKE_PIDFILE"] = data.GetString("make-pidfile")
env["MANIFEST_BUILD_DEBIAN_DEPENDS"] = data.GetString("depends")
env["MANIFEST_BUILD_DEBIAN_DESCRIPTION"] = data.GetString("description")
env["MANIFEST_BUILD_DEBIAN_INIT"] = data.GetString("init")
env["MANIFEST_BUILD_DEBIAN_CRON"] = data.GetString("cron")
env["GO_PIPELINE_LABEL"] = data.GetString("build-number")
env["GO_STAGE_COUNTER"] = data.GetString("stage-counter")
return utils.RunCmdWithEnv(
fmt.Sprintf("%s/go/debian-build.sh --distribution=%s", data.GetString("ci-tools-path"), data.GetString("distribution")),
env,
)
}