Documentation
¶
Index ¶
- Constants
- func CheckJob(ctx context.Context, db gorp.SqlExecutor, job *sdk.Job) error
- func CheckParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, paramName string) (bool, error)
- func CountStageByPipelineID(db gorp.SqlExecutor, pipelineID int64) (int, error)
- func CreateAudit(db gorp.SqlExecutor, pip *sdk.Pipeline, action string, u sdk.Identifiable) error
- func DeleteAllParameterFromPipeline(db gorp.SqlExecutor, pipelineID int64) error
- func DeleteAllStage(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) error
- func DeleteAudit(db gorp.SqlExecutor, pipID int64) error
- func DeleteJob(db gorp.SqlExecutor, job sdk.Job) error
- func DeleteParameterFromPipeline(db gorp.SqlExecutor, pipelineID int64, paramName string) error
- func DeletePipeline(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) error
- func DeletePipelineActionByStage(ctx context.Context, db gorp.SqlExecutor, stageID int64) error
- func DeleteStageByID(ctx context.Context, tx gorp.SqlExecutor, s *sdk.Stage) error
- func ExistPipeline(db gorp.SqlExecutor, projectID int64, name string) (bool, error)
- func Export(ctx context.Context, db gorp.SqlExecutor, key string, name string) (exportentities.PipelineV1, error)
- func GetAllParametersInPipeline(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) ([]sdk.Parameter, error)
- func Import(ctx context.Context, db gorp.SqlExecutor, store cache.Store, proj sdk.Project, ...) error
- func ImportUpdate(ctx context.Context, db gorp.SqlExecutor, proj sdk.Project, pip *sdk.Pipeline, ...) error
- func InsertJob(db gorp.SqlExecutor, job *sdk.Job, stageID int64, pip *sdk.Pipeline) error
- func InsertParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, param *sdk.Parameter) error
- func InsertPipeline(db gorp.SqlExecutor, p *sdk.Pipeline) error
- func InsertStage(db gorp.SqlExecutor, s *sdk.Stage) error
- func LoadAllByIDs(db gorp.SqlExecutor, ids []int64, loadDependencies bool) ([]sdk.Pipeline, error)
- func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)
- func LoadAllNamesByFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) (sdk.IDNames, error)
- func LoadAudit(db gorp.SqlExecutor, key string, pipName string) ([]sdk.PipelineAudit, error)
- func LoadAuditByID(db gorp.SqlExecutor, id int64) (sdk.PipelineAudit, error)
- func LoadByWorkerModel(ctx context.Context, db gorp.SqlExecutor, model *sdk.Model) ([]sdk.Pipeline, error)
- func LoadByWorkerModelAndGroupIDs(ctx context.Context, db gorp.SqlExecutor, model *sdk.Model, groupIDs []int64) ([]sdk.Pipeline, error)
- func LoadByWorkflowID(db gorp.SqlExecutor, workflowID int64) ([]sdk.Pipeline, error)
- func LoadPipeline(ctx context.Context, db gorp.SqlExecutor, projectKey, name string, deep bool) (*sdk.Pipeline, error)
- func LoadPipelineByID(ctx context.Context, db gorp.SqlExecutor, pipelineID int64, deep bool) (*sdk.Pipeline, error)
- func LoadPipelineStage(ctx context.Context, db gorp.SqlExecutor, p *sdk.Pipeline) error
- func LoadPipelines(db gorp.SqlExecutor, projectID int64, loadDependencies bool) ([]sdk.Pipeline, error)
- func LoadStage(db gorp.SqlExecutor, pipelineID int64, stageID int64) (*sdk.Stage, error)
- func MoveStage(db gorp.SqlExecutor, stageToMove *sdk.Stage, newBuildOrder int, ...) error
- func ParseAndImport(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, ...) (*sdk.Pipeline, []sdk.Message, error)
- func PurgeAudits(ctx context.Context, db gorp.SqlExecutor) error
- func ResetFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) error
- func UpdateJob(ctx context.Context, db gorp.SqlExecutor, job *sdk.Job) error
- func UpdateParameterInPipeline(db gorp.SqlExecutor, pipelineID int64, oldParamName string, ...) error
- func UpdatePipeline(db gorp.SqlExecutor, p *sdk.Pipeline) error
- func UpdatePipelineAction(db gorp.SqlExecutor, job sdk.Job) error
- func UpdateStage(db gorp.SqlExecutor, s *sdk.Stage) error
- type ImportOptions
- type Pipeline
- type PipelineAudit
- type Pipelines
Constants ¶
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 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 ¶
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 ¶
DeletePipeline remove given pipeline and all history from database
func DeletePipelineActionByStage ¶
DeletePipelineActionByStage Delete all action from a stage
func DeleteStageByID ¶
DeleteStageByID Delete stage with associated pipeline action
func ExistPipeline ¶
ExistPipeline Check if the given pipeline exist in database
func Export ¶
func Export(ctx context.Context, db gorp.SqlExecutor, key string, name string) (exportentities.PipelineV1, error)
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 InsertParameterInPipeline ¶
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 ¶
LoadAllByIDs loads all pipelines
func LoadAllNames ¶
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 ¶
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 ¶
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 MoveStage ¶
func MoveStage(db gorp.SqlExecutor, stageToMove *sdk.Stage, newBuildOrder int, p *sdk.Pipeline) error
MoveStage Move a stage
func ParseAndImport ¶
func ParseAndImport(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, epip exportentities.Pipeliner, u sdk.Identifiable, opts ImportOptions) (*sdk.Pipeline, []sdk.Message, error)
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 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 ¶
ImportOptions are options to import pipeline
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