示例#1
0
文件: debian.go 项目: kulikov/serve
func (p DeployDebian) Uninstall(data manifest.Manifest) error {
	if err := utils.RunSshCmd(
		data.GetString("cluster"),
		data.GetString("ssh-user"),
		fmt.Sprintf("sudo apt-get purge %s -y", data.GetString("package")),
	); err != nil {
		return err
	}

	return utils.DeletePluginData("deploy.debian", data.GetString("app-name"), data.GetString("consul-address"))
}
示例#2
0
文件: tarball.go 项目: kulikov/serve
func (p DeployTarball) Uninstall(data manifest.Manifest) error {
	if err := utils.RunParallelSshCmd(
		data.GetString("cluster"),
		data.GetString("ssh-user"),
		fmt.Sprint("sudo rm -rf "+data.GetString("install-root")+"/"+data.GetString("package-name")),
		50,
	); err != nil {
		return err
	}

	return utils.DeletePluginData("deploy.tarball", data.GetString("package-name"), data.GetString("consul-address"))
}
示例#3
0
文件: marathon.go 项目: kulikov/serve
func (p DeployMarathon) Uninstall(data manifest.Manifest) error {
	marathonApi, err := MarathonClient(data.GetString("marathon-address"))
	if err != nil {
		return err
	}

	name := data.GetString("app-name")

	if _, err := marathonApi.Application(name); err == nil {
		if _, err := marathonApi.DeleteApplication(name, false); err != nil {
			return err
		}
	} else {
		log.Println(color.YellowString("App `%s` doesnt exists in marathon!", name))
	}

	return utils.DeletePluginData("deploy.marathon", name, data.GetString("consul-address"))
}