runners

package
v0.0.0-...-10d6098 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 32 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdContent

type CmdContent struct {
	Id string `json:"id"`
	//Gid string `json:"gid"`
	//Pid   string    `json:"pid"`
	Conts string `json:"conts"`
}

type Config

type Config struct {
	Name      string
	Workspace string
	Limit     int
	Plugin    []string
	Env       []string
}

type DirEntry

type DirEntry struct {
	Name  string
	IsDir bool
	Size  int64
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(cfg Config, itr IExecute) *Engine

func (*Engine) Run

func (c *Engine) Run(ctx context.Context) error

func (*Engine) Stop

func (c *Engine) Stop()

func (*Engine) Stopd

func (c *Engine) Stopd() bool

type FileStat

type FileStat struct {
	Name  string
	IsDir bool
	Size  int64
}

type IExecute

type IExecute interface {
	ServerInfo() (*ServerInfo, error)
	PullJob(name string, plugs []string) (*RunJob, error)
	CheckCancel(buildId string) bool
	Update(m *UpdateJobInfo) error
	UpdateCmd(buildId, jobId, cmdId string, fs, code int) error // fs:1:run,2:end
	PushOutLine(buildId, jobId, cmdId, bs string, iserr bool) error
	FindJobId(buildId, stgNm, stpNm string) (string, bool)

	ReadDir(fs int, buildId string, pth string) ([]*DirEntry, error)
	ReadFile(fs int, buildId string, pth string, start int64) (int64, io.ReadCloser, error)
	GetEnv(buildId, jobId, key string) (string, bool)
	FindArtVersionId(buildId, idnt string, name string) (string, error)

	NewArtVersionId(buildId, idnt string, name string) (string, error)
	StatFile(fs int, buildId, jobId string, dir, pth string) (*FileStat, error)
	UploadFile(fs int, buildId, jobId string, dir, pth string, start int64) (io.WriteCloser, error)
	GenEnv(buildId, jobId string, env utils.EnvVal) error
}

type ReqPullJob

type ReqPullJob struct {
	Name  string
	Plugs []string
}

type RunJob

type RunJob struct {
	Id           string
	PipelineId   string
	StageId      string
	BuildId      string
	StageName    string
	Step         string
	Name         string
	Input        map[string]string
	Env          map[string]string
	OriginRepo   string
	UsersRepo    string
	Commands     []*CmdContent
	Artifacts    []*runtime.Artifact
	UseArtifacts []*runtime.UseArtifact
}

type ServerInfo

type ServerInfo struct {
	WebHost   string
	DownToken string
}

type UpdateJobInfo

type UpdateJobInfo struct {
	BuildId  string
	JobId    string
	Status   string
	Error    string
	ExitCode int
}

Jump to

Keyboard shortcuts

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