示例#1
0
文件: pod.go 项目: dataVerve/jetpack
func cmdRun(pod *jetpack.Pod) (erv error) {
	if flAppName.Empty() {
		if len(pod.Manifest.Apps) != 1 {
			return errors.New("Multi-app pod! Please use -app=NAME to choose")
		} else {
			flAppName = pod.Manifest.Apps[0].Name
		}
	}
	if flDestroy {
		defer func() {
			if err := pod.Destroy(); err != nil {
				if erv == nil {
					erv = err
				} else {
					// TODO: UI
					fmt.Fprintln(os.Stderr, "ERROR destroying pod:", err)
				}
			}
		}()
	}
	return errors.Trace(pod.RunApp(flAppName, nil))
}
示例#2
0
文件: pod.go 项目: dataVerve/jetpack
func cmdDestroyPod(pod *jetpack.Pod) error {
	return errors.Trace(pod.Destroy())
}