Rewrite to new yaml format

This commit is contained in:
2022-12-31 15:31:07 +01:00
parent 9ebc4715ed
commit 46715cf033
21 changed files with 462 additions and 259 deletions
+7 -10
View File
@@ -6,24 +6,21 @@ import (
"gopkg.in/yaml.v3"
)
// Operation is an enum of various operations
// Operation should have at least one key in "source", "use", "target". The remaining keys are options for that operation
type Operation map[string]any
type EntryPoint struct {
Source string `yaml:",omitempty"`
Pipeline []Operation `yaml:",omitempty"`
type Pipeline struct {
Pipeline []Operation `yaml:"pipeline"`
}
type Options struct {
type BuildOptions struct {
// Excludes lists files and folders to globally exclude from compilation
Excludes []string `yaml:",omitempty"`
// Include []string `yaml:",omitempty"`
Output string `yaml:",omitempty"`
}
// Cabretfile has some configuration for the
type Cabretfile struct {
Options Options `yaml:",omitempty"`
EntryPoints []*EntryPoint `yaml:"entryPoints"`
Options BuildOptions
Build []Pipeline
}
func ReadCabretfile(file string) (*Cabretfile, error) {