// Cap process func (c Cap) PROCESS() string { if !c.git.Used { return "release" } branch := c.git.Branch if c.git.Err != nil { return "release" } if utils.IndexOfStrings(c.spec.Beta, branch) != -1 { return "beta" } if utils.IndexOfStrings(c.spec.Release, branch) != -1 { return "release" } return "develop" }
func NewSpec(data []byte, filename string) (res *Spec, err error) { err = yaml.Unmarshal(data, &res) if err != nil { return } abs, err := filepath.Abs(filepath.Join(filepath.Dir(filename), res.Root)) res.Root = abs if utils.IndexOfStrings(res.Release, "master") == -1 { res.Release = append(res.Release, "master") } if res.Dockerfile == "" { res.Dockerfile = "__from__\n" } return }