parser

package
v1.6.7-0...-b28dd99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobStageTest   = "test"
	JobStageDeploy = "deploy"
)

Job stage constants

Variables

This section is empty.

Functions

func GenerateGlobalEnv

func GenerateGlobalEnv(build *core.Build) []string

GenerateGlobalEnv generates global env variables.

Types

type BranchesConfig

type BranchesConfig struct {
	Test   []string `yaml:"test"`
	Ignore []string `yaml:"ignore"`
}

BranchesConfig defines structure for branches config in .abstruse.yml file.

type ConfigParser

type ConfigParser struct {
	Raw    string
	Branch string
	Parsed RepoConfig
	Env    []string
	Mount  []string
}

ConfigParser defines repository configuration parser.

func NewConfigParser

func NewConfigParser(raw, branch string, env []string, mount []string) ConfigParser

NewConfigParser returns new config parser instance.

func (*ConfigParser) Parse

func (c *ConfigParser) Parse() ([]*JobConfig, error)

Parse parses raw config.

func (*ConfigParser) ShouldBuild

func (c *ConfigParser) ShouldBuild() bool

ShouldBuild checks if build should be triggered considering the test and ignore branches configuration.

type JobConfig

type JobConfig struct {
	Image    string           `json:"image"`
	Env      []string         `json:"env"`
	Mount    string           `json:"mount"`
	Stage    string           `json:"stage"`
	Title    string           `json:"title"`
	Commands *api.CommandList `json:"commands"`
	Cache    []string         `json:"cache"`
}

JobConfig represents generated job configuration.

type MatrixConfig

type MatrixConfig struct {
	Env   string `yaml:"env"`
	Image string `yaml:"image"`
}

MatrixConfig defines structure for matrix job config in .abstruse.yml file.

type RepoConfig

type RepoConfig struct {
	Image         string         `yaml:"image"`
	Branches      BranchesConfig `yaml:"branches"`
	Matrix        []MatrixConfig `yaml:"matrix"`
	BeforeInstall []string       `yaml:"before_install"`
	Install       []string       `yaml:"install"`
	BeforeScript  []string       `yaml:"before_script"`
	Script        []string       `yaml:"script"`
	AfterSuccess  []string       `yaml:"after_success"`
	AfterFailure  []string       `yaml:"after_failure"`
	BeforeDeploy  []string       `yaml:"before_deploy"`
	Deploy        []string       `yaml:"deploy"`
	AfterDeploy   []string       `yaml:"after_deploy"`
	AfterScript   []string       `yaml:"after_script"`
	Cache         []string       `yaml:"cache"`
}

RepoConfig defines structure for .abstruse.yml configuration files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL