models

package
v0.0.0-...-0f212ae Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StepRunStatusCodeSuccess ...
	StepRunStatusCodeSuccess = 0
	// StepRunStatusCodeFailed ...
	StepRunStatusCodeFailed = 1
	// StepRunStatusCodeFailedSkippable ...
	StepRunStatusCodeFailedSkippable = 2
	// StepRunStatusCodeSkipped ...
	StepRunStatusCodeSkipped = 3
	// StepRunStatusCodeSkippedWithRunIf ...
	StepRunStatusCodeSkippedWithRunIf = 4

	// Version ...
	Version = "5"
)

Variables

This section is empty.

Functions

func GetStepIDStepDataPair

func GetStepIDStepDataPair(stepListItem StepListItemModel) (string, stepmanModels.StepModel, error)

GetStepIDStepDataPair ...

func MergeEnvironmentWith

func MergeEnvironmentWith(env *envmanModels.EnvironmentItemModel, otherEnv envmanModels.EnvironmentItemModel) error

MergeEnvironmentWith ...

func MergeStepWith

func MergeStepWith(step, otherStep stepmanModels.StepModel) (stepmanModels.StepModel, error)

MergeStepWith ...

Types

type AppModel

type AppModel struct {
	Title        string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary      string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description  string                              `json:"description,omitempty" yaml:"description,omitempty"`
	Environments []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
}

AppModel ...

func (*AppModel) FillMissingDefaults

func (app *AppModel) FillMissingDefaults() error

FillMissingDefaults ...

func (*AppModel) Normalize

func (app *AppModel) Normalize() error

Normalize ...

func (*AppModel) Validate

func (app *AppModel) Validate() error

Validate ...

type BitriseDataModel

type BitriseDataModel struct {
	FormatVersion        string `json:"format_version" yaml:"format_version"`
	DefaultStepLibSource string `json:"default_step_lib_source,omitempty" yaml:"default_step_lib_source,omitempty"`
	ProjectType          string `json:"project_type" yaml:"project_type"`
	//
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Summary     string `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	//
	App        AppModel                 `json:"app,omitempty" yaml:"app,omitempty"`
	TriggerMap TriggerMapModel          `json:"trigger_map,omitempty" yaml:"trigger_map,omitempty"`
	Workflows  map[string]WorkflowModel `json:"workflows,omitempty" yaml:"workflows,omitempty"`
}

BitriseDataModel ...

func (*BitriseDataModel) FillMissingDefaults

func (config *BitriseDataModel) FillMissingDefaults() error

FillMissingDefaults ...

func (*BitriseDataModel) Normalize

func (config *BitriseDataModel) Normalize() error

Normalize ...

func (*BitriseDataModel) RemoveRedundantFields

func (config *BitriseDataModel) RemoveRedundantFields() error

RemoveRedundantFields ...

func (*BitriseDataModel) Validate

func (config *BitriseDataModel) Validate() ([]string, error)

Validate ...

type BuildRunResultsModel

type BuildRunResultsModel struct {
	StartTime            time.Time             `json:"start_time" yaml:"start_time"`
	StepmanUpdates       map[string]int        `json:"stepman_updates" yaml:"stepman_updates"`
	SuccessSteps         []StepRunResultsModel `json:"success_steps" yaml:"success_steps"`
	FailedSteps          []StepRunResultsModel `json:"failed_steps" yaml:"failed_steps"`
	FailedSkippableSteps []StepRunResultsModel `json:"failed_skippable_steps" yaml:"failed_skippable_steps"`
	SkippedSteps         []StepRunResultsModel `json:"skipped_steps" yaml:"skipped_steps"`
}

BuildRunResultsModel ...

func (BuildRunResultsModel) HasFailedSkippableSteps

func (buildRes BuildRunResultsModel) HasFailedSkippableSteps() bool

HasFailedSkippableSteps ...

func (BuildRunResultsModel) IsBuildFailed

func (buildRes BuildRunResultsModel) IsBuildFailed() bool

IsBuildFailed ...

func (BuildRunResultsModel) IsStepLibUpdated

func (buildRes BuildRunResultsModel) IsStepLibUpdated(stepLib string) bool

IsStepLibUpdated ...

func (BuildRunResultsModel) OrderedResults

func (buildRes BuildRunResultsModel) OrderedResults() []StepRunResultsModel

OrderedResults ...

func (BuildRunResultsModel) ResultsCount

func (buildRes BuildRunResultsModel) ResultsCount() int

ResultsCount ...

type StepIDData

type StepIDData struct {
	// SteplibSource : steplib source uri, or in case of local path just "path", and in case of direct git url just "git"
	SteplibSource string
	// IDOrURI : ID if steplib is provided, URI if local step or in case a direct git url provided
	IDorURI string
	// Version : version in the steplib, or in case of a direct git step the tag-or-branch to use
	Version string
}

StepIDData ... structured representation of a composite-step-id

a composite step id is: step-lib-source::step-id@1.0.0

func CreateStepIDDataFromString

func CreateStepIDDataFromString(compositeVersionStr, defaultStepLibSource string) (StepIDData, error)

CreateStepIDDataFromString ... compositeVersionStr examples:

func (StepIDData) IsUniqueResourceID

func (sIDData StepIDData) IsUniqueResourceID() bool

IsUniqueResourceID : true if this ID is a unique resource ID, which is true if the ID refers to the exact same step code/data every time. Practically, this is only true for steps from StepLibrary collections, a local path or direct git step ID is never guaranteed to identify the same resource every time, the step's behaviour can change at every execution!

__If the ID is a Unique Resource ID then the step can be cached (locally)__, as it won't change between subsequent step execution.

type StepListItemModel

type StepListItemModel map[string]stepmanModels.StepModel

StepListItemModel ...

type StepRunResultsModel

type StepRunResultsModel struct {
	StepInfo stepmanModels.StepInfoModel `json:"step_info" yaml:"step_info"`
	Status   int                         `json:"status" yaml:"status"`
	Idx      int                         `json:"idx" yaml:"idx"`
	RunTime  time.Duration               `json:"run_time" yaml:"run_time"`
	ErrorStr string                      `json:"error_str" yaml:"error_str"`
	ExitCode int                         `json:"exit_code" yaml:"exit_code"`
}

StepRunResultsModel ...

type TriggerEventType

type TriggerEventType string

TriggerEventType ...

const (
	// TriggerEventTypeCodePush ...
	TriggerEventTypeCodePush TriggerEventType = "code-push"
	// TriggerEventTypePullRequest ...
	TriggerEventTypePullRequest TriggerEventType = "pull-request"
	// TriggerEventTypeTag ...
	TriggerEventTypeTag TriggerEventType = "tag"
	// TriggerEventTypeUnknown ...
	TriggerEventTypeUnknown TriggerEventType = "unkown"
)

type TriggerMapItemModel

type TriggerMapItemModel struct {
	PushBranch              string `json:"push_branch,omitempty" yaml:"push_branch,omitempty"`
	PullRequestSourceBranch string `json:"pull_request_source_branch,omitempty" yaml:"pull_request_source_branch,omitempty"`
	PullRequestTargetBranch string `json:"pull_request_target_branch,omitempty" yaml:"pull_request_target_branch,omitempty"`
	Tag                     string `json:"tag,omitempty" yaml:"tag,omitempty"`
	WorkflowID              string `json:"workflow,omitempty" yaml:"workflow,omitempty"`

	// deprecated
	Pattern              string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
	IsPullRequestAllowed bool   `json:"is_pull_request_allowed,omitempty" yaml:"is_pull_request_allowed,omitempty"`
}

TriggerMapItemModel ...

func (TriggerMapItemModel) MatchWithParams

func (triggerItem TriggerMapItemModel) MatchWithParams(pushBranch, prSourceBranch, prTargetBranch, tag string) (bool, error)

MatchWithParams ...

func (TriggerMapItemModel) String

func (triggerItem TriggerMapItemModel) String(printWorkflow bool) string

func (TriggerMapItemModel) Validate

func (triggerItem TriggerMapItemModel) Validate() error

Validate ...

type TriggerMapModel

type TriggerMapModel []TriggerMapItemModel

TriggerMapModel ...

func (TriggerMapModel) Validate

func (triggerMap TriggerMapModel) Validate() error

Validate ...

type WorkflowModel

type WorkflowModel struct {
	Title        string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary      string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description  string                              `json:"description,omitempty" yaml:"description,omitempty"`
	BeforeRun    []string                            `json:"before_run,omitempty" yaml:"before_run,omitempty"`
	AfterRun     []string                            `json:"after_run,omitempty" yaml:"after_run,omitempty"`
	Environments []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
	Steps        []StepListItemModel                 `json:"steps,omitempty" yaml:"steps,omitempty"`
	Meta         map[string]interface{}              `json:"meta,omitempty" yaml:"meta,omitempty"`
}

WorkflowModel ...

func (*WorkflowModel) FillMissingDefaults

func (workflow *WorkflowModel) FillMissingDefaults(title string) error

FillMissingDefaults ...

func (*WorkflowModel) Normalize

func (workflow *WorkflowModel) Normalize() error

Normalize ...

func (*WorkflowModel) Validate

func (workflow *WorkflowModel) Validate() ([]string, error)

Validate ...

Jump to

Keyboard shortcuts

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