tasks

package
v0.2.54 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Readln

func Readln(r *bufio.Reader) (string, error)

Readln reads from the pipe

Types

type Alert

type Alert struct {
	TaskID          string
	Name            string
	TaskURL         string
	ChatID          string
	TaskResult      string
	TaskDescription string
	TaskVersion     string
	Author          string
	Color           string
	From            string
}

Alert represents an alert that will be templated and sent to the appropriate service

type Job

type Job interface {
	Run(username string, incomingVersion *string) error
	Kill()
}

type LocalJob

type LocalJob struct {
	// Received constant fields
	Task        db.Task
	Template    db.Template
	Inventory   db.Inventory
	Repository  db.Repository
	Environment db.Environment
	Playbook    *db_lib.AnsiblePlaybook
	Logger      lib.Logger

	// Internal field
	Process *os.Process
	// contains filtered or unexported fields
}

func (*LocalJob) Kill

func (t *LocalJob) Kill()

func (*LocalJob) Log

func (t *LocalJob) Log(msg string)

func (*LocalJob) Run

func (t *LocalJob) Run(username string, incomingVersion *string) (err error)

func (*LocalJob) SetStatus

func (t *LocalJob) SetStatus(status lib.TaskStatus)

type RemoteJob

type RemoteJob struct {
	Task        db.Task
	Template    db.Template
	Inventory   db.Inventory
	Repository  db.Repository
	Environment db.Environment
	Playbook    *db_lib.AnsiblePlaybook
	Logger      lib.Logger
	// contains filtered or unexported fields
}

func (*RemoteJob) Kill

func (t *RemoteJob) Kill()

func (*RemoteJob) Run

func (t *RemoteJob) Run(username string, incomingVersion *string) (err error)

type TaskPool

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

func CreateTaskPool

func CreateTaskPool(store db.Store) TaskPool

func (*TaskPool) AddTask

func (p *TaskPool) AddTask(taskObj db.Task, userID *int, projectID int) (newTask db.Task, err error)

func (*TaskPool) GetNumberOfRunningTasksOfRunner

func (p *TaskPool) GetNumberOfRunningTasksOfRunner(runnerID int) (res int)

func (*TaskPool) GetRunningTasks

func (p *TaskPool) GetRunningTasks() (res []*TaskRunner)

func (*TaskPool) GetTask

func (p *TaskPool) GetTask(id int) (task *TaskRunner)

func (*TaskPool) Run

func (p *TaskPool) Run()

nolint: gocyclo

func (*TaskPool) StopTask

func (p *TaskPool) StopTask(targetTask db.Task, forceStop bool) error

type TaskRunner

type TaskRunner struct {
	Task        db.Task
	Template    db.Template
	Inventory   db.Inventory
	Repository  db.Repository
	Environment db.Environment

	RunnerID        int
	Username        string
	IncomingVersion *string
	// contains filtered or unexported fields
}

func (*TaskRunner) Log

func (t *TaskRunner) Log(msg string)

func (*TaskRunner) Log2

func (t *TaskRunner) Log2(msg string, now time.Time)

func (*TaskRunner) LogCmd

func (t *TaskRunner) LogCmd(cmd *exec.Cmd)

func (*TaskRunner) SetStatus

func (t *TaskRunner) SetStatus(status lib.TaskStatus)

Jump to

Keyboard shortcuts

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