Documentation ¶
Index ¶
- type OperateAction
- type PipelineSvc
- func (s *PipelineSvc) AllValidBranchWorkspaces(appID uint64) (map[string]string, error)
- func (s *PipelineSvc) BatchConvert2PagePipeline(pipelines []spec.Pipeline) []apistructs.PagePipeline
- func (s *PipelineSvc) BatchCreate(batchReq *apistructs.PipelineBatchCreateRequest) (map[string]*apistructs.PipelineDTO, error)
- func (s *PipelineSvc) BatchCreateLabels(createReq *apistructs.PipelineLabelBatchInsertRequest) error
- func (s *PipelineSvc) Cancel(req *apistructs.PipelineCancelRequest) error
- func (s *PipelineSvc) ClusterHook(clusterEvent apistructs.ClusterEvent) error
- func (s *PipelineSvc) ContinueCompensate()
- func (s *PipelineSvc) Convert2PagePipeline(p *spec.Pipeline) *apistructs.PagePipeline
- func (s *PipelineSvc) ConvertPipeline(p *spec.Pipeline) *apistructs.PipelineDTO
- func (s *PipelineSvc) Create(req *apistructs.PipelineCreateRequest) (*spec.Pipeline, error)
- func (s *PipelineSvc) CreateV2(req *apistructs.PipelineCreateRequestV2) (*spec.Pipeline, error)
- func (s *PipelineSvc) CronNotExecuteCompensateById(id uint64) error
- func (s *PipelineSvc) DealPipelineCallbackOfAction(data []byte) (err error)
- func (s *PipelineSvc) Delete(pipelineID uint64) error
- func (s *PipelineSvc) Detail(pipelineID uint64) (*apistructs.PipelineDetailDTO, error)
- func (s *PipelineSvc) FetchPlatformSecrets(p *spec.Pipeline, ignoreKeys []string) (map[string]string, error)
- func (s *PipelineSvc) FetchSecrets(p *spec.Pipeline) (secrets, cmsDiceFiles map[string]string, holdOnKeys []string, err error)
- func (s *PipelineSvc) Get(pipelineID uint64) (*spec.Pipeline, error)
- func (s *PipelineSvc) GetOpenapiOAuth2TokenForActionInvokeOpenapi(task *spec.PipelineTask) (*apistructs.OpenapiOAuth2Token, error)
- func (s *PipelineSvc) HandleQueryPipelineYamlBySnippetConfigs(sourceSnippetConfigs []apistructs.SnippetConfig) (map[string]string, error)
- func (s *PipelineSvc) List(condition apistructs.PipelinePageListRequest) (*apistructs.PipelinePageListData, error)
- func (s *PipelineSvc) ListLabels(req *apistructs.PipelineLabelListRequest) (*apistructs.PipelineLabelPageListData, error)
- func (s *PipelineSvc) Operate(pipelineID uint64, req *apistructs.PipelineOperateRequest) error
- func (s *PipelineSvc) PipelineYmlGraph(req *apistructs.PipelineYmlParseGraphRequest) (*apistructs.PipelineYml, error)
- func (s *PipelineSvc) PreCheck(p *spec.Pipeline) error
- func (s *PipelineSvc) QueryDetails(req *apistructs.SnippetQueryDetailsRequest) (map[string]apistructs.SnippetQueryDetail, error)
- func (s *PipelineSvc) Rerun(req *apistructs.PipelineRerunRequest) (*spec.Pipeline, error)
- func (s *PipelineSvc) RerunFailed(req *apistructs.PipelineRerunFailedRequest) (*spec.Pipeline, error)
- func (s *PipelineSvc) RunCronPipelineFunc(id uint64)
- func (s *PipelineSvc) RunPipeline(req *apistructs.PipelineRunRequest) (*spec.Pipeline, error)
- func (s *PipelineSvc) SimplePipelineBaseDetail(pipelineID uint64) (*apistructs.PipelineDetailDTO, error)
- func (s *PipelineSvc) Statistic(source, clusterName string) (*apistructs.PipelineStatisticResponseData, error)
- func (s *PipelineSvc) SyncAfterSplitTable()
- func (s *PipelineSvc) TaskDetail(taskID uint64) (*spec.PipelineTask, error)
- func (s *PipelineSvc) UpdatePipelineCron(p *spec.Pipeline, cronStartFrom *time.Time, configManageNamespaces []string, ...) error
- func (s *PipelineSvc) UpgradePipelineCron(pc *spec.PipelineCron) error
- func (s *PipelineSvc) WithCmsService(cmsService pb.CmsServiceServer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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) (map[string]string, error)
func (*PipelineSvc) BatchConvert2PagePipeline ¶
func (s *PipelineSvc) BatchConvert2PagePipeline(pipelines []spec.Pipeline) []apistructs.PagePipeline
func (*PipelineSvc) BatchCreate ¶
func (s *PipelineSvc) BatchCreate(batchReq *apistructs.PipelineBatchCreateRequest) ( map[string]*apistructs.PipelineDTO, error)
func (*PipelineSvc) BatchCreateLabels ¶ added in v1.0.1
func (s *PipelineSvc) BatchCreateLabels(createReq *apistructs.PipelineLabelBatchInsertRequest) error
func (*PipelineSvc) Cancel ¶
func (s *PipelineSvc) Cancel(req *apistructs.PipelineCancelRequest) error
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()
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 ¶
func (s *PipelineSvc) Create(req *apistructs.PipelineCreateRequest) (*spec.Pipeline, error)
Deprecated
func (*PipelineSvc) CreateV2 ¶
func (s *PipelineSvc) CreateV2(req *apistructs.PipelineCreateRequestV2) (*spec.Pipeline, error)
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) 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 []string, err error)
FetchSecrets return secrets, cmsDiceFiles and error. holdOnKeys: 声明 key 需要持有,不能被平台 secrets 覆盖,与 ignoreKeys 配合使用
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 (s *PipelineSvc) List(condition apistructs.PipelinePageListRequest) (*apistructs.PipelinePageListData, error)
func (*PipelineSvc) ListLabels ¶ added in v1.0.1
func (s *PipelineSvc) ListLabels(req *apistructs.PipelineLabelListRequest) (*apistructs.PipelineLabelPageListData, error)
func (*PipelineSvc) Operate ¶
func (s *PipelineSvc) Operate(pipelineID uint64, req *apistructs.PipelineOperateRequest) error
func (*PipelineSvc) PipelineYmlGraph ¶
func (s *PipelineSvc) PipelineYmlGraph(req *apistructs.PipelineYmlParseGraphRequest) (*apistructs.PipelineYml, error)
func (*PipelineSvc) QueryDetails ¶ added in v1.1.0
func (s *PipelineSvc) QueryDetails(req *apistructs.SnippetQueryDetailsRequest) (map[string]apistructs.SnippetQueryDetail, error)
handleQueryPipelineYamlBySnippetConfigs 统一查询 snippetConfigs
func (*PipelineSvc) Rerun ¶
func (s *PipelineSvc) Rerun(req *apistructs.PipelineRerunRequest) (*spec.Pipeline, error)
Rerun commit 不变
func (*PipelineSvc) RerunFailed ¶
func (s *PipelineSvc) RerunFailed(req *apistructs.PipelineRerunFailedRequest) (*spec.Pipeline, error)
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) SyncAfterSplitTable ¶
func (s *PipelineSvc) SyncAfterSplitTable()
SyncAfterSplitTable 表结构拆分后,extra 表里有些字段需要移动 commit 字段处理:移动到 commit_detail 中,并将 commit 字段置空作为标志位 org_name 字段处理:移动到 normal_labels 中,简单起见,同样使用 commit 字段为空作为标志位
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)
Source Files ¶
- action_output_handler.go
- batch_create.go
- branch.go
- callback.go
- cancel.go
- clusterinfo.go
- convert.go
- create.go
- create_label.go
- create_snippet.go
- create_task.go
- create_v2.go
- cron.go
- cron_compensate.go
- define.go
- delete.go
- detail.go
- graph.go
- list.go
- operate.go
- passedDataWhenCreate.go
- pipeline_resources.go
- precheck.go
- queue.go
- rerun.go
- rerun_failed.go
- run.go
- secret.go
- snippet.go
- sync_after_split_table.go
- task.go
- user.go