本文整理汇总了Golang中github.com/blablacar/cnt/log.Get函数的典型用法代码示例。如果您正苦于以下问题:Golang Get函数的具体用法?Golang Get怎么用?Golang Get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Push
func (p *Pod) Push() {
log.Get().Info("Push POD", p.manifest.Name)
p.Build()
for _, e := range p.manifest.Pod.Apps {
aci, err := NewAciWithManifest(p.path+"/"+e.Name, p.args, p.toAciManifest(e))
if err != nil {
log.Get().Panic(err)
}
aci.PodName = &p.manifest.Name
aci.Push()
}
utils.ExecCmd("curl", "-i",
"-F", "r=releases",
"-F", "hasPom=false",
"-F", "e=pod",
"-F", "g=com.blablacar.aci.linux.amd64",
"-F", "p=pod",
"-F", "v="+p.manifest.Name.Version(),
"-F", "a="+p.manifest.Name.ShortName(),
"-F", "[email protected]"+p.target+POD_TARGET_MANIFEST,
"-u", config.GetConfig().Push.Username+":"+config.GetConfig().Push.Password,
config.GetConfig().Push.Url+"/service/local/artifact/maven/content")
}
示例2: Test
func (cnt *Img) Test() {
log.Get().Info("Testing " + cnt.manifest.NameAndVersion)
if _, err := os.Stat(cnt.target + "/image.aci"); os.IsNotExist(err) {
if err := cnt.Build(); err != nil {
log.Get().Panic("Cannot Install since build failed")
}
}
// prepare runner in target
// run contauner with mout mpoint
// run real service in background
// run tests
//
// BATS
os.MkdirAll(cnt.target+"/test", 0777)
bats.WriteBats(cnt.target + "/test")
// if err := utils.ExecCmd("systemd-nspawn", "--directory=" + cnt.rootfs, "--capability=all",
// "--bind=" + cnt.target + "/:/target", "--share-system", "target/build.sh"); err != nil {
// log.Get().Panic("Build step did not succeed", err)
//
//
// utils.ExecCmd("rkt", "--insecure-skip-verify=true", "run", cnt.target + "/image.aci") // TODO missing command override that will arrive in next RKT version
// }
}
示例3: discoverAndRunUpdateType
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 {
log.Get().Panic("Not Yet implemented for pods")
} else {
log.Get().Panic("Cannot find cnt-manifest.yml")
}
}
示例4: copyRunlevelsPrestart
func (cnt *Img) copyRunlevelsPrestart() {
if err := os.MkdirAll(cnt.rootfs+"/etc/prestart/late-prestart.d", 0755); err != nil {
log.Get().Panic(err)
}
if err := os.MkdirAll(cnt.rootfs+"/etc/prestart/early-prestart.d", 0755); err != nil {
log.Get().Panic(err)
}
utils.CopyDir(cnt.path+RUNLEVELS_PRESTART, cnt.rootfs+"/etc/prestart/early-prestart.d")
utils.CopyDir(cnt.path+RUNLEVELS_LATESTART, cnt.rootfs+"/etc/prestart/late-prestart.d")
}
示例5: WritePodManifest
func WritePodManifest(im *schema.PodManifest, targetFile string) {
buff, err := im.MarshalJSON()
if err != nil {
log.Get().Panic(err)
}
err = ioutil.WriteFile(targetFile, []byte(buff), 0644)
if err != nil {
log.Get().Panic(err)
}
}
示例6: Test
func (p *Pod) Test() {
log.Get().Info("Testing POD", p.manifest.Name)
for _, e := range p.manifest.Pod.Apps {
aci, err := NewAciWithManifest(p.path+"/"+e.Name, p.args, p.toAciManifest(e))
if err != nil {
log.Get().Panic(err)
}
aci.PodName = &p.manifest.Name
aci.Test()
}
}
示例7: UnmarshalJSON
func (n *ACFullname) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {
log.Get().Panic(err)
return err
}
nn, err := NewACFullName(s)
if err != nil {
log.Get().Panic(err)
return err
}
*n = *nn
return nil
}
示例8: copyConfd
func (cnt *Img) copyConfd() {
if err := os.MkdirAll(cnt.rootfs+"/etc/prestart/", 0755); err != nil {
log.Get().Panic(err)
}
utils.CopyDir(cnt.path+CONFD_CONFIG, cnt.rootfs+"/etc/prestart/conf.d")
utils.CopyDir(cnt.path+CONFD_TEMPLATE, cnt.rootfs+"/etc/prestart/templates")
}
示例9: Clean
func (p *Pod) Clean() {
log.Get().Info("Cleaning POD", p.manifest.Name)
if err := os.RemoveAll(p.target + "/"); err != nil {
log.Get().Panic("Cannot clean", p.manifest.Name, err)
}
for _, e := range p.manifest.Pod.Apps {
aci, err := NewAciWithManifest(p.path+"/"+e.Name, p.args, p.toAciManifest(e))
if err != nil {
log.Get().Panic(err)
}
aci.PodName = &p.manifest.Name
aci.Clean()
}
}
示例10: ExecCmd
func ExecCmd(head string, parts ...string) error {
log.Get().Debug("Exec > ", head, " ", strings.Join(parts, " "))
cmd := exec.Command(head, parts...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
示例11: UserHomeOrFatal
func UserHomeOrFatal() string {
usr, err := homedir.Dir()
if err != nil {
log.Get().Panic(err)
}
return usr
}
示例12: checkBuilt
func (i *Img) checkBuilt() {
if _, err := os.Stat(i.target + "/image.aci"); os.IsNotExist(err) {
if err := i.Build(); err != nil {
log.Get().Panic("Cannot Install since build failed")
}
}
}
示例13: NewAci
func NewAci(path string, args BuildArgs) (*Img, error) {
manifest, err := readManifest(path + IMG_MANIFEST)
if err != nil {
log.Get().Debug(path, IMG_MANIFEST+" does not exists")
return nil, err
}
return NewAciWithManifest(path, args, *manifest)
}
示例14: writeImgManifest
func (cnt *Img) writeImgManifest() {
log.Get().Debug("Writing aci manifest")
version := cnt.manifest.NameAndVersion.Version()
if version == "" {
version = utils.GenerateVersion()
}
utils.WriteImageManifest(&cnt.manifest, cnt.target+"/manifest", cnt.manifest.NameAndVersion.Name(), version)
}
示例15: runlevelBuildSetup
func (cnt *Img) runlevelBuildSetup() {
files, err := ioutil.ReadDir(cnt.path + RUNLEVELS_BUILD_SETUP)
if err != nil {
return
}
os.Setenv("BASEDIR", cnt.path)
os.Setenv("TARGET", cnt.target)
for _, f := range files {
if !f.IsDir() {
log.Get().Info("Running Build setup level : ", f.Name())
if err := utils.ExecCmd(cnt.path + RUNLEVELS_BUILD_SETUP + "/" + f.Name()); err != nil {
log.Get().Panic(err)
}
}
}
}