pipelinesvc

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRegistryLabel added in v1.3.0

func AddRegistryLabel(r map[string]string, clusterInfo apistructs.ClusterInfoData) map[string]string

AddRegistryLabel Support third-party docker registry

func ReplaceProjectApplication added in v1.3.0

func ReplaceProjectApplication(r map[string]string) map[string]string

ReplaceProjectApplication Determine the splicing result according to the given registry addresses of different types

Types

type OperateAction

type OperateAction string
var (
	OpDisableTask OperateAction = "DISABLE-TASK"
	OpEnableTask  OperateAction = "ENABLE-TASK"
	OpPauseTask   OperateAction = "PAUSE-TASK"
	OpUnpauseTask OperateAction = "UNPAUSE-TASK"
)

type PipelineSvc

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

func New

func New(appSvc *appsvc.AppSvc, crondSvc *crondsvc.CrondSvc,
	actionAgentSvc *actionagentsvc.ActionAgentSvc, extMarketSvc *extmarketsvc.ExtMarketSvc,
	pipelineCronSvc *pipelinecronsvc.PipelineCronSvc, permissionSvc *permissionsvc.PermissionSvc,
	queueManage *queuemanage.QueueManage,
	dbClient *dbclient.Client, bdl *bundle.Bundle, publisher *websocket.Publisher,
	engine *pipengine.Engine, js jsonstore.JsonStore, etcd *etcd.Store) *PipelineSvc

func (*PipelineSvc) AllValidBranchWorkspaces

func (s *PipelineSvc) AllValidBranchWorkspaces(appID uint64, userID string) (map[string]string, error)

func (*PipelineSvc) BatchConvert2PagePipeline

func (s *PipelineSvc) BatchConvert2PagePipeline(pipelines []spec.Pipeline) []apistructs.PagePipeline

func (*PipelineSvc) BatchCreate

func (*PipelineSvc) BatchCreateLabels added in v1.0.1

func (s *PipelineSvc) BatchCreateLabels(createReq *apistructs.PipelineLabelBatchInsertRequest) error

func (*PipelineSvc) Cancel

func (*PipelineSvc) ClusterHook added in v1.1.0

func (s *PipelineSvc) ClusterHook(clusterEvent apistructs.ClusterEvent) error

ClusterHook listen and dispatch cluster event from eventbox

func (*PipelineSvc) ContinueCompensate

func (s *PipelineSvc) ContinueCompensate(ctx context.Context)

func (*PipelineSvc) Convert2PagePipeline

func (s *PipelineSvc) Convert2PagePipeline(p *spec.Pipeline) *apistructs.PagePipeline

func (*PipelineSvc) ConvertPipeline

func (s *PipelineSvc) ConvertPipeline(p *spec.Pipeline) *apistructs.PipelineDTO

func (*PipelineSvc) Create

Deprecated

func (*PipelineSvc) CreatePipelineGraph added in v1.3.0

func (s *PipelineSvc) CreatePipelineGraph(p *spec.Pipeline) (err error)

createPipelineGraph recursively create pipeline graph.

func (*PipelineSvc) CreateV2

func (*PipelineSvc) CronNotExecuteCompensateById

func (s *PipelineSvc) CronNotExecuteCompensateById(id uint64) error

func (*PipelineSvc) DealPipelineCallbackOfAction

func (s *PipelineSvc) DealPipelineCallbackOfAction(data []byte) (err error)

func (*PipelineSvc) Delete

func (s *PipelineSvc) Delete(pipelineID uint64) error

func (*PipelineSvc) Detail

func (s *PipelineSvc) Detail(pipelineID uint64) (*apistructs.PipelineDetailDTO, error)

func (*PipelineSvc) DoCrondAbout added in v1.3.0

func (s *PipelineSvc) DoCrondAbout(ctx context.Context)

func (*PipelineSvc) FetchPlatformSecrets

func (s *PipelineSvc) FetchPlatformSecrets(p *spec.Pipeline, ignoreKeys []string) (map[string]string, error)

FetchPlatformSecrets 获取平台级别 secrets ignoreKeys: 平台只生成不在 ignoreKeys 列表中的 secrets

func (*PipelineSvc) FetchSecrets

func (s *PipelineSvc) FetchSecrets(p *spec.Pipeline) (secrets, cmsDiceFiles map[string]string, holdOnKeys, encryptSecretKeys []string, err error)

FetchSecrets return secrets, cmsDiceFiles and error. holdOnKeys: 声明 key 需要持有,不能被平台 secrets 覆盖,与 ignoreKeys 配合使用

func (*PipelineSvc) Get

func (s *PipelineSvc) Get(pipelineID uint64) (*spec.Pipeline, error)

func (*PipelineSvc) GetOpenapiOAuth2TokenForActionInvokeOpenapi

func (s *PipelineSvc) GetOpenapiOAuth2TokenForActionInvokeOpenapi(task *spec.PipelineTask) (*apistructs.OpenapiOAuth2Token, error)

func (*PipelineSvc) HandleQueryPipelineYamlBySnippetConfigs added in v1.1.0

func (s *PipelineSvc) HandleQueryPipelineYamlBySnippetConfigs(sourceSnippetConfigs []apistructs.SnippetConfig) (map[string]string, error)

handleQueryPipelineYamlBySnippetConfigs 统一查询 snippetConfigs

func (*PipelineSvc) List

func (*PipelineSvc) ListLabels added in v1.0.1

func (*PipelineSvc) MakeSnippetPipeline4Create added in v1.3.0

func (s *PipelineSvc) MakeSnippetPipeline4Create(p *spec.Pipeline, snippetTask *spec.PipelineTask, yamlContent string) (*spec.Pipeline, error)

createSnippetPipeline4Create 为 snippetTask 创建流水线对象

func (*PipelineSvc) MergePipelineYmlTasks added in v1.3.0

func (s *PipelineSvc) MergePipelineYmlTasks(pipelineYml *pipelineyml.PipelineYml, dbTasks []spec.PipelineTask, p *spec.Pipeline, dbStages []spec.PipelineStage, passedDataWhenCreate *action_info.PassedDataWhenCreate) (mergeTasks []spec.PipelineTask, err error)

replace the tasks parsed by yml and tasks in the database with the same name

func (*PipelineSvc) Operate

func (s *PipelineSvc) Operate(pipelineID uint64, req *apistructs.PipelineOperateRequest) error

func (*PipelineSvc) OperateTask added in v1.3.0

func (s *PipelineSvc) OperateTask(p *spec.Pipeline, task *spec.PipelineTask) (*spec.PipelineTask, error)

determine whether the task status is disabled according to the TaskOperates of the pipeline and task extra disable field

func (*PipelineSvc) PipelineYmlGraph

func (*PipelineSvc) PreCheck

func (s *PipelineSvc) PreCheck(pipelineYml *pipelineyml.PipelineYml, p *spec.Pipeline, stages []spec.PipelineStage, userID string) error

func (*PipelineSvc) QueryDetails added in v1.1.0

handleQueryPipelineYamlBySnippetConfigs 统一查询 snippetConfigs

func (*PipelineSvc) Rerun

Rerun commit 不变

func (*PipelineSvc) RerunFailed

func (*PipelineSvc) RunCronPipelineFunc

func (s *PipelineSvc) RunCronPipelineFunc(id uint64)

RunCronPipelineFunc 定时触发时会先创建 pipeline 记录,然后尝试执行; 如果因为某些因素(比如并行数量限制)不能立即执行,用户后续仍然可以再次手动执行这条 pipeline。

func (*PipelineSvc) RunPipeline

func (s *PipelineSvc) RunPipeline(req *apistructs.PipelineRunRequest) (*spec.Pipeline, error)

func (*PipelineSvc) SimplePipelineBaseDetail added in v1.1.0

func (s *PipelineSvc) SimplePipelineBaseDetail(pipelineID uint64) (*apistructs.PipelineDetailDTO, error)

func (*PipelineSvc) Statistic

func (s *PipelineSvc) Statistic(source, clusterName string) (*apistructs.PipelineStatisticResponseData, error)

Statistic pipeline 运行情况统计

func (*PipelineSvc) TaskDetail

func (s *PipelineSvc) TaskDetail(taskID uint64) (*spec.PipelineTask, error)

func (*PipelineSvc) UpdatePipelineCron

func (s *PipelineSvc) UpdatePipelineCron(p *spec.Pipeline, cronStartFrom *time.Time, configManageNamespaces []string, cronCompensator *pipelineyml.CronCompensator) error

非定时触发的,如果有定时配置,需要插入或更新 pipeline_crons enable 配置 不管是定时还是非定时,只要定时配置是空的,就将pipeline_crons disable

func (*PipelineSvc) UpgradePipelineCron

func (s *PipelineSvc) UpgradePipelineCron(pc *spec.PipelineCron) error

更新老数据 1) 根据 application 和 branch 获取元数据 2) 根据 basePipelineID 获取元数据

func (*PipelineSvc) WithCmsService added in v1.1.0

func (s *PipelineSvc) WithCmsService(cmsService pb.CmsServiceServer)

Jump to

Keyboard shortcuts

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