Example #1
0
File: test.go Project: vcaputo/cnt
func discoverAndRunTestType(path string, args builder.BuildArgs) {
	if cnt, err := builder.NewAci(path, args); err == nil {
		cnt.Test()
	} else if pod, err := builder.OpenPod(path, args); err == nil {
		pod.Test()
	} else {
		panic("Cannot find cnt-manifest.yml")
	}
}
Example #2
0
File: graph.go Project: vcaputo/cnt
func discoverAndRunGraphType(path string, args builder.BuildArgs) {
	if cnt, err := builder.NewAci(path, args); err == nil {
		cnt.Graph()
	} else if pod, err2 := builder.OpenPod(path, args); err2 == nil {
		pod.Graph()
	} else {
		panic("Cannot find cnt-manifest.yml or cnt-pod-manifest.yml" + err.Error() + err2.Error())
	}
}
Example #3
0
func discoverAndRunUpdateType(path string, args builder.BuildArgs) {
	if cnt, err := builder.NewAci(path, args); err == nil {
		cnt.UpdateConf()
	} else if _, err := builder.OpenPod(path, args); err == nil {
		panic("Not Yet implemented for pods")
	} else {
		panic("Cannot find cnt-manifest.yml")
	}
}
Example #4
0
File: cnt.go Project: PrFalken/cnt
func discoverAndRunCleanType(path string, args builder.BuildArgs) {
	if cnt, err := builder.NewAci(path, args); err == nil {
		cnt.Clean()
	} else if pod, err := builder.OpenPod(path, args); err == nil {
		pod.Clean()
	} else {
		log.Get().Panic("Cannot find cnt-manifest.yml")
	}
}
Example #5
0
func buildAciOrPod(path string, args builder.BuildArgs) spec.CntCommand {
	if aci, err := builder.NewAci(path, args); err == nil {
		return aci
	} else if pod, err2 := builder.NewPod(path, args); err2 == nil {
		return pod
	} else {
		logs.WithField("path", path).WithField("err", err).WithField("err2", err2).Fatal("Cannot construct aci or pod")
	}
	return nil
}