Example #1
0
func (aci *Aci) tarAci(zip bool) {
	target := PATH_IMAGE_ACI[1:]
	if zip {
		target = PATH_IMAGE_ACI_ZIP[1:]
	}
	dir, _ := os.Getwd()
	logs.WithField("path", aci.target).Debug("chdir")
	os.Chdir(aci.target)
	utils.Tar(zip, target, PATH_MANIFEST[1:], PATH_ROOTFS[1:])
	logs.WithField("path", dir).Debug("chdir")
	os.Chdir(dir)
}
Example #2
0
File: aci.go Project: vcaputo/cnt
func (cnt *Img) tarAci(zip bool) {
	target := PATH_IMAGE_ACI[1:]
	if zip {
		target = PATH_IMAGE_ACI_ZIP[1:]
	}
	dir, _ := os.Getwd()
	log.Debug("chdir to", cnt.target)
	os.Chdir(cnt.target)
	utils.Tar(zip, target, PATH_MANIFEST[1:], PATH_ROOTFS[1:])
	log.Debug("chdir to", dir)
	os.Chdir(dir)
}
Example #3
0
func (cnt *Img) tarAci() {
	dir, _ := os.Getwd()
	log.Get().Debug("chdir to", cnt.target)
	os.Chdir(cnt.target)

	args := []string{"manifest", "rootfs/"}

	if _, err := os.Stat(cnt.path + RUNLEVELS_BUILD_INHERIT_EARLY); err == nil {
		args = append(args, strings.TrimPrefix(RUNLEVELS_BUILD_INHERIT_EARLY, "/"))
	}
	if _, err := os.Stat(cnt.path + RUNLEVELS_BUILD_INHERIT_LATE); err == nil {
		args = append(args, strings.TrimPrefix(RUNLEVELS_BUILD_INHERIT_LATE, "/"))
	}

	utils.Tar(cnt.args.Zip, "image.aci", args...)
	log.Get().Debug("chdir to", dir)
	os.Chdir(dir)
}