engine

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerClean

func ContainerClean(id string, ctx context.Context, cli *client.Client)

func Engine

func Engine(cli *client.Client, ctx context.Context, w Workflow, sID string, vol types.Volume, dir string, allOutputs map[string][]Env, wg *sync.WaitGroup, skippedStages *[]string)

func FindVolume

func FindVolume(name string, ctx context.Context, cli *client.Client) (volume *types.Volume, err error)

func GenEnv

func GenEnv(e []Env) []string

func ImageExists

func ImageExists(image string, ctx context.Context, cli *client.Client) bool

func PullImage

func PullImage(image string, ctx context.Context, cli *client.Client)

func RemoveVolume

func RemoveVolume(name string, ctx context.Context, cli *client.Client) (removed bool, err error)

func RunStage

func RunStage(s Stage, ctx context.Context, cli *client.Client, envs []Env, globalImage string, volume types.Volume, dir string, volumeOutput types.Volume, dirOutput string, LwWhite *logger.MyLogWriter)

func ToGraph

func ToGraph(w Workflow)

Types

type Env

type Env struct {
	Name  string `mapstructure:"name" validate:"nonzero,nowhitespace"`
	Value string `mapstructure:"value" validate:"nonzero"`
}

func GenEnvFromArgs

func GenEnvFromArgs(e []Input) []Env

func ReadPropertiesFile

func ReadPropertiesFile(filename string) ([]Env, error)

type Input

type Input struct {
	Name     string `mapstructure:"name" validate:"nonzero,nowhitespace"`
	Default  string `mapstructure:"default"`
	Optional bool   `mapstructure:"optional,omitempty"`
}

type Stage

type Stage struct {
	Stage     string   `mapstructure:"stage" validate:"nonzero"`
	ID        string   `mapstructure:"id,omitempty" validate:"nonzero,nowhitespace"`
	Script    []string `mapstructure:"script" validate:"nonzero"`
	If        string   `mapstructure:"if,omitempty"`
	Clean     bool     `mapstructure:"clean,omitempty"`
	Env       []Env    `mapstructure:"env,omitempty"`
	Artifacts []string `mapstructure:"artifacts,omitempty"`
	Image     string   `mapstructure:"image,omitempty"`
	Needs     string   `mapstructure:"needs,omitempty" validate:"nowhitespace"`
}

type Workflow

type Workflow struct {
	ID          string  `mapstructure:"id" validate:"nonzero,nowhitespace"`
	Image       string  `mapstructure:"image" validate:"nonzero,nowhitespace"`
	Description string  `mapstructure:"description"`
	Env         []Env   `mapstructure:"env"`
	Input       []Input `mapstructure:"input"`
	Mount       bool    `mapstructure:"mount"`
	Stages      []Stage `mapstructure:"stages" validate:"nonzero"`
	Repo        string  `mapstructure:"repository,omitempty"` // To be filled automatically. Not part of YAML.
}

Jump to

Keyboard shortcuts

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