示例#1
0
文件: sbt.go 项目: kulikov/serve
func (p SbtBuild) Run(data manifest.Manifest) error {
	return utils.RunCmd(
		`sbt ';set every version := "%s"' clean "%s" %s`,
		data.GetString("version"),
		data.GetString("test"),
		data.GetStringOr("sbt", ""),
	)
}
示例#2
0
func (p DBCreatePostgresql) Create(data manifest.Manifest) error {
	var cmd string

	if data.Has("source") {
		t := data.GetString("target")
		cmd = fmt.Sprintf("sudo -Hu postgres createdb -O %s \"%s\" && sudo -Hu postgres pg_dump \"%s\" | sudo -Hu postgres psql \"%s\"",
			data.GetStringOr("db-user", "postgres"), t, data.GetString("source"), t)

	} else {
		cmd = fmt.Sprintf("sudo -Hu postgres createdb -O %s \"%s\"",
			data.GetStringOr("db-user", "postgres"), data.GetString("target"))
	}

	return utils.RunSingleSshCmd(data.GetString("host"), data.GetString("ssh-user"), cmd)
}