pipeline

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 19 Imported by: 60

Documentation

Index

Constants

View Source
const (
	AuditAddJob         = "addJob"
	AuditUpdateJob      = "updateJob"
	AuditDeleteJob      = "deleteJob"
	AuditAddStage       = "addStage"
	AuditUpdateStage    = "updateStage"
	AuditDeleteStage    = "deleteStage"
	AuditMoveStage      = "moveStage"
	AuditUpdatePipeline = "updatePipeline"
)

Audit constants

Variables

This section is empty.

Functions

func CheckJob

func CheckJob(ctx context.Context, db gorp.SqlExecutor, job *sdk.Job) error

CheckJob validate a job

func CheckParameterInPipeline

func CheckParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, paramName string) (bool, error)

CheckParameterInPipeline check if the parameter is already in the pipeline or not

func CountStageByPipelineID

func CountStageByPipelineID(db gorp.SqlExecutor, pipelineID int64) (int, error)

CountStageByPipelineID Count the number of stages for the given pipeline

func CreateAudit

func CreateAudit(db gorp.SqlExecutor, pip *sdk.Pipeline, action string, u sdk.Identifiable) error

CreateAudit insert current pipeline version on audit table

func DeleteAllParameterFromPipeline

func DeleteAllParameterFromPipeline(db gorp.SqlExecutor, pipelineID int64) error

DeleteAllParameterFromPipeline Delete all parameters from the given pipeline

func DeleteAllStage

func DeleteAllStage(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) error

DeleteAllStage Delete all stages from pipeline ID

func DeleteAudit

func DeleteAudit(db gorp.SqlExecutor, pipID int64) error

DeleteAudit delete audit related to given pipeline

func DeleteJob

func DeleteJob(db gorp.SqlExecutor, job sdk.Job) error

DeleteJob Delete a job ( action + pipeline_action )

func DeleteParameterFromPipeline

func DeleteParameterFromPipeline(db gorp.SqlExecutor, pipelineID int64, paramName string) error

DeleteParameterFromPipeline Delete a parameter from the given pipeline

func DeletePipeline

func DeletePipeline(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) error

DeletePipeline remove given pipeline and all history from database

func DeletePipelineActionByStage

func DeletePipelineActionByStage(ctx context.Context, db gorp.SqlExecutor, stageID int64) error

DeletePipelineActionByStage Delete all action from a stage

func DeleteStageByID

func DeleteStageByID(ctx context.Context, tx gorp.SqlExecutor, s *sdk.Stage) error

DeleteStageByID Delete stage with associated pipeline action

func ExistPipeline

func ExistPipeline(db gorp.SqlExecutor, projectID int64, name string) (bool, error)

ExistPipeline Check if the given pipeline exist in database

func Export

Export a pipeline

func GetAllParametersInPipeline

func GetAllParametersInPipeline(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) ([]sdk.Parameter, error)

GetAllParametersInPipeline Get all parameters for the given pipeline

func Import

func Import(ctx context.Context, db gorp.SqlExecutor, store cache.Store, proj sdk.Project, pip *sdk.Pipeline, msgChan chan<- sdk.Message, u sdk.Identifiable) error

Import insert the pipeline in the project

func ImportUpdate

func ImportUpdate(ctx context.Context, db gorp.SqlExecutor, proj sdk.Project, pip *sdk.Pipeline, msgChan chan<- sdk.Message, opts ImportOptions) error

ImportUpdate import and update the pipeline in the project

func InsertJob

func InsertJob(db gorp.SqlExecutor, job *sdk.Job, stageID int64, pip *sdk.Pipeline) error

InsertJob Insert a new Job ( pipeline_action + joinedAction )

func InsertParameterInPipeline

func InsertParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, param *sdk.Parameter) error

InsertParameterInPipeline Insert a new parameter in the given pipeline

func InsertPipeline

func InsertPipeline(db gorp.SqlExecutor, p *sdk.Pipeline) error

InsertPipeline inserts pipeline informations in database

func InsertStage

func InsertStage(db gorp.SqlExecutor, s *sdk.Stage) error

InsertStage insert given stage into given database

func LoadAllByIDs

func LoadAllByIDs(db gorp.SqlExecutor, ids []int64, loadDependencies bool) ([]sdk.Pipeline, error)

LoadAllByIDs loads all pipelines

func LoadAllNames

func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)

LoadAllNames returns all pipeline names

func LoadAllNamesByFromRepository

func LoadAllNamesByFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) (sdk.IDNames, error)

LoadAllNamesByFromRepository returns all pipeline names for a repository

func LoadAudit

func LoadAudit(db gorp.SqlExecutor, key string, pipName string) ([]sdk.PipelineAudit, error)

LoadAudit load audit for the given pipeline

func LoadAuditByID

func LoadAuditByID(db gorp.SqlExecutor, id int64) (sdk.PipelineAudit, error)

LoadAuditByID load audit for the given audit id

func LoadByWorkerModel

func LoadByWorkerModel(ctx context.Context, db gorp.SqlExecutor, model *sdk.Model) ([]sdk.Pipeline, error)

LoadByWorkerModel loads pipelines from database for a given worker model.

func LoadByWorkerModelAndGroupIDs

func LoadByWorkerModelAndGroupIDs(ctx context.Context, db gorp.SqlExecutor, model *sdk.Model, groupIDs []int64) ([]sdk.Pipeline, error)

LoadByWorkerModelAndGroupIDs loads pipelines from database for a given worker model and group ids.

func LoadByWorkflowID

func LoadByWorkflowID(db gorp.SqlExecutor, workflowID int64) ([]sdk.Pipeline, error)

LoadByWorkflowID loads pipelines from database for a given workflow id

func LoadPipeline

func LoadPipeline(ctx context.Context, db gorp.SqlExecutor, projectKey, name string, deep bool) (*sdk.Pipeline, error)

LoadPipeline loads a pipeline from database

func LoadPipelineByID

func LoadPipelineByID(ctx context.Context, db gorp.SqlExecutor, pipelineID int64, deep bool) (*sdk.Pipeline, error)

LoadPipelineByID loads a pipeline from database

func LoadPipelineStage

func LoadPipelineStage(ctx context.Context, db gorp.SqlExecutor, p *sdk.Pipeline) error

LoadPipelineStage loads pipeline stage

func LoadPipelines

func LoadPipelines(db gorp.SqlExecutor, projectID int64, loadDependencies bool) ([]sdk.Pipeline, error)

LoadPipelines loads all pipelines in a project

func LoadStage

func LoadStage(db gorp.SqlExecutor, pipelineID int64, stageID int64) (*sdk.Stage, error)

LoadStage Get a stage from its ID and pipeline ID

func MoveStage

func MoveStage(db gorp.SqlExecutor, stageToMove *sdk.Stage, newBuildOrder int, p *sdk.Pipeline) error

MoveStage Move a stage

func ParseAndImport

ParseAndImport parse an exportentities.pipeline and insert or update the pipeline in database

func PurgeAudits

func PurgeAudits(ctx context.Context, db gorp.SqlExecutor) error

func ResetFromRepository

func ResetFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) error

ResetFromRepository reset fromRepository for all pipelines using the same fromRepository in a given project

func UpdateJob

func UpdateJob(ctx context.Context, db gorp.SqlExecutor, job *sdk.Job) error

UpdateJob updates the job by actionData.PipelineActionID and actionData.ID

func UpdateParameterInPipeline

func UpdateParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, oldParamName string, param sdk.Parameter) error

UpdateParameterInPipeline Update a parameter in the given pipeline

func UpdatePipeline

func UpdatePipeline(db gorp.SqlExecutor, p *sdk.Pipeline) error

UpdatePipeline update the pipeline

func UpdatePipelineAction

func UpdatePipelineAction(db gorp.SqlExecutor, job sdk.Job) error

UpdatePipelineAction Update an action in a pipeline

func UpdateStage

func UpdateStage(db gorp.SqlExecutor, s *sdk.Stage) error

UpdateStage update Stage and all its prequisites

Types

type ImportOptions

type ImportOptions struct {
	Force          bool
	PipelineName   string
	FromRepository string
}

ImportOptions are options to import pipeline

type Pipeline

type Pipeline sdk.Pipeline

Pipeline is a gorp wrapper around sdk.Pipeline

func (*Pipeline) PostGet

func (pip *Pipeline) PostGet(db gorp.SqlExecutor) error

type PipelineAudit

type PipelineAudit sdk.PipelineAudit

PipelineAudit is a gorp wrapper around sdk.PipelineAudit

func (*PipelineAudit) PostGet

func (p *PipelineAudit) PostGet(s gorp.SqlExecutor) error

PostGet is a dbHook on Select to get json column

func (*PipelineAudit) PostInsert

func (p *PipelineAudit) PostInsert(s gorp.SqlExecutor) error

PostInsert is a DB Hook on PostInsert to store pipeline JSON in DB

type Pipelines

type Pipelines []Pipeline

func (Pipelines) Cast

func (dbPipes Pipelines) Cast() []sdk.Pipeline

Jump to

Keyboard shortcuts

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