Documentation ¶
Index ¶
- func NewWorkFlowProvide(driver, addr, user, token, jobName string, flowProcessor jenkins.FlowProcessor) (workflow.WorkFlow, error)
- func StepStruct(sc string) ([]subTask, error)
- type AppMergeInfo
- type AppParamsForCreatePublishJob
- type AppParamsForHealthCheck
- type AutoTestReportRsp
- type BaseStepReq
- type BuildStepCallbackReq
- type BuildStepReq
- type BuildStepResp
- type ClusterListRsp
- type DenyEnvItem
- type DenyEnvList
- type DeployStepAppRsp
- type DeployStepReq
- type EnvItem
- type FakePublishJobRsp
- type FlowStageReq
- type JenkinsConfigRsp
- type ManualStepReq
- type ManualStepResp
- type MergeBranchStepApp
- type MergeBranchStepResp
- type PipelineBaseReq
- type PipelineConfig
- type PipelineManager
- func (pm *PipelineManager) AutoTriggerNextStep(publish *models.Publish, nextStepType string) (int64, int64, string, error)
- func (pm *PipelineManager) CheckCurrentStepWhertherLastStageLastStep(publishID, stageID int64) (bool, bool, error)
- func (pm *PipelineManager) CreateBuildJob(creator string, projectID, publishID int64, envStageJSON *PipelineStageStruct, ...) (int64, string, error)
- func (pm *PipelineManager) CreateDeployJob(creator string, projectID, publishID int64, stageJSON *PipelineStageStruct, ...) (int64, string, error)
- func (pm *PipelineManager) CreatePublishJob(projectID, publishID, stageID int64, operator string, jobType string, ...) (int64, error)
- func (pm *PipelineManager) CreateTaskTmpl(request *TaskTmplReq, creator string) error
- func (pm *PipelineManager) DeleteTaskTmpl(stepID int64) error
- func (pm *PipelineManager) GetCIConfig(stageID int64) ([]string, error)
- func (pm *PipelineManager) GetFirstStepByPipelineInstanceIDAndStageID(instanceID, stageID int64) (string, string, error)
- func (pm *PipelineManager) GetFlowComponents() ([]*models.FlowComponent, error)
- func (pm *PipelineManager) GetJenkinsConfig(stageID int64) (*JenkinsConfigRsp, error)
- func (pm *PipelineManager) GetNextStepType(publishID int64, stepIndex int) (string, string, error)
- func (pm *PipelineManager) GetNextStepTypeByStageID(instanceID, stageID int64, stepIndex int) (string, error)
- func (pm *PipelineManager) GetPipelineInstanceEnvStageByID(pipelineInstanceID, stageID int64) (*PipelineStageStruct, error)
- func (pm *PipelineManager) GetPipelineInstanceJSONByID(pipelineInstanceID int64) (PipelineConfig, error)
- func (pm *PipelineManager) GetPublishStats(projectID int64, request *PublishStatsReq) ([]*PublishStatsRsp, error)
- func (pm *PipelineManager) GetStepInfo(projectID int64, publishID int64, stageID int64, stepName string) (interface{}, error)
- func (pm *PipelineManager) GetTaskTmplByName(name string) (*models.TaskTmpl, error)
- func (pm *PipelineManager) GetTaskTmpls() ([]TaskTmplResp, error)
- func (pm *PipelineManager) GetTaskTmplsByPagination(filter *query.FilterQuery) (*query.QueryResult, error)
- func (pm *PipelineManager) RunBuildDeployCallBackStep(request *BuildStepCallbackReq) (int64, error)
- func (pm *PipelineManager) RunBuildStep(projectID, publishID, stageID int64, creator, stepName string, ...) (int64, int64, string, error)
- func (pm *PipelineManager) RunDeployStep(projectID, publishID, stageID int64, creator, stepName string, ...) (int64, int64, string, error)
- func (pm *PipelineManager) RunManualStep(publishID, stageID int64, request *ManualStepReq) (int64, error)
- func (pm *PipelineManager) UpdatePublishJob(publishJobID, runID int64) error
- func (pm *PipelineManager) UpdatePublishJobStatus(publishJobID int64, status string) error
- func (pm *PipelineManager) UpdateTaskTmpl(request *TaskTmplReq, stepID int64) error
- type PipelineSetupReq
- type PipelineStageStruct
- type PipelineSteps
- type ProjectWhiteIDs
- type PublishApplyStepReq
- type PublishAuditStepReq
- type PublishJobAppRsp
- type PublishJobBuildResult
- type PublishJobRsp
- type PublishSetupReq
- type PublishStatsReq
- type PublishStatsRsp
- type PublishStepReq
- type PublishStepResp
- type ResetPipelineReq
- type RunBuildAllParms
- type RunBuildAppReq
- type RunDeployAllParms
- type RunDeployAppReq
- type RunPublishAllParms
- type RunPublishAppReq
- type StepRsp
- type StepTemplate
- type SubTask
- type TaskTmplReq
- type TaskTmplResp
- type WeeklyDenyList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWorkFlowProvide ¶
func NewWorkFlowProvide(driver, addr, user, token, jobName string, flowProcessor jenkins.FlowProcessor) (workflow.WorkFlow, error)
NewWorkFlowProvide new workflow provide
Types ¶
type AppMergeInfo ¶
type AppMergeInfo struct { Name string `json:"name"` SourceBranch string `json:"source_branch"` TargetBranch string `json:"target_branch"` Result string `json:"result"` IsSuccess bool `json:"isSuccess"` Error string `json:"error"` }
AppMergeInfo ..
type AppParamsForCreatePublishJob ¶
type AppParamsForCreatePublishJob struct { ProjectAppID int64 `json:"project_app_id"` Branch string `json:"branch"` Path string `json:"path"` ImageVersion string `json:"image_version"` Gray bool `json:"gray"` ImageAddr string `json:"image_addr"` }
AppParamsForCreatePublishJob ..
type AppParamsForHealthCheck ¶
type AppParamsForHealthCheck struct { ID int64 `json:"id"` Name string `json:"name"` Type string `json:"type"` FullName string `json:"full_name"` }
AppParamsForHealthCheck ..
type AutoTestReportRsp ¶
type AutoTestReportRsp struct { SonarReportURL string `json:"sonar_report_url"` AppName string `json:"app_name"` CurrentRevision string `json:"current_revision"` BranchName string `json:"branch_name"` JacocoReportURL string `json:"jacoco_report_url"` }
AutoTestReportRsp ..
type BaseStepReq ¶
type BaseStepReq struct {
Status string `json:"status"`
}
BaseStepReq [Verify Step]..
type BuildStepCallbackReq ¶
type BuildStepCallbackReq struct {
PublishJobID int64 `json:"publish_job_id"`
}
BuildStepCallbackReq ..
type BuildStepReq ¶
type BuildStepReq struct { ActionName string `json:"action_name,omitempty"` Apps []*RunBuildAppReq `json:"apps,omitempty"` EnvVars []EnvItem `json:"env_vars,omitempty"` }
BuildStepReq ..
type BuildStepResp ¶
type BuildStepResp struct { Apps []*PublishStepResp `json:"apps"` VersionNo string `json:"versionNo"` VersionName string `json:"versionName"` }
BuildStepResp ..
type ClusterListRsp ¶
type ClusterListRsp struct { Jenkins []*clusterItem `json:"jenkins"` K8s []*clusterItem `json:"k8s"` }
ClusterListRsp ..
type DenyEnvItem ¶
type DenyEnvItem struct { Name string `json:"name"` Env string `json:"env"` Enable bool `json:"deny"` }
DenyEnvItem ..
type DeployStepAppRsp ¶
type DeployStepAppRsp struct { Type string `json:"type"` Name string `json:"name"` ProjectAppID int64 `json:"project_app_id"` }
DeployStepAppRsp ..
type DeployStepReq ¶
type DeployStepReq struct { ActionName string `json:"action_name"` Apps []*RunDeployAppReq `json:"apps"` }
DeployStepReq ..
type FakePublishJobRsp ¶
FakePublishJobRsp ..
type FlowStageReq ¶
type FlowStageReq struct { Name string `json:"name"` Description string `json:"description"` Cluster string `json:"cluster"` CIServer string `json:"ci_server"` ArrangeEnv string `json:"arrange_env"` }
FlowStageReq create stage
type JenkinsConfigRsp ¶
type JenkinsConfigRsp struct {
Jenkins string `json:"jenkins"`
}
JenkinsConfigRsp ..
type ManualStepReq ¶
ManualStepReq ..
type ManualStepResp ¶
type ManualStepResp struct { PreviousStep *StepRsp `json:"previous_step"` CurrenStep *StepRsp `json:"current_step"` }
ManualStepResp ..
type MergeBranchStepApp ¶
type MergeBranchStepApp struct { *models.PublishApp TargetBranch []string `json:"target_branch"` AppName string `json:"app_name"` }
MergeBranchStepApp ..
type MergeBranchStepResp ¶
type MergeBranchStepResp struct { *models.Publish Apps []*MergeBranchStepApp `json:"apps"` }
MergeBranchStepResp ..
type PipelineBaseReq ¶
type PipelineBaseReq struct { Description string `json:"description"` Name string `json:"name"` ID int64 `json:"id"` Enabled bool `json:"enabled"` IsDefault bool `json:"is_default"` }
PipelineBaseReq ..
type PipelineConfig ¶
type PipelineConfig []*PipelineStageStruct
PipelineConfig ..
func (PipelineConfig) Struct ¶
func (config PipelineConfig) Struct(sc string) (PipelineConfig, error)
Struct ..
type PipelineManager ¶
type PipelineManager struct {
// contains filtered or unexported fields
}
PipelineManager ...
func (*PipelineManager) AutoTriggerNextStep ¶
func (pm *PipelineManager) AutoTriggerNextStep(publish *models.Publish, nextStepType string) (int64, int64, string, error)
AutoTriggerNextStep ..
func (*PipelineManager) CheckCurrentStepWhertherLastStageLastStep ¶
func (pm *PipelineManager) CheckCurrentStepWhertherLastStageLastStep(publishID, stageID int64) (bool, bool, error)
CheckCurrentStepWhertherLastStageLastStep ..
func (*PipelineManager) CreateBuildJob ¶
func (pm *PipelineManager) CreateBuildJob(creator string, projectID, publishID int64, envStageJSON *PipelineStageStruct, apps []*RunBuildAppReq, customeEnvVars []EnvItem) (int64, string, error)
CreateBuildJob return publishjob run id, error
func (*PipelineManager) CreateDeployJob ¶
func (pm *PipelineManager) CreateDeployJob(creator string, projectID, publishID int64, stageJSON *PipelineStageStruct, apps []*RunDeployAppReq) (int64, string, error)
CreateDeployJob return publishjob run id, error
func (*PipelineManager) CreatePublishJob ¶
func (pm *PipelineManager) CreatePublishJob(projectID, publishID, stageID int64, operator string, jobType string, allAppsParms []*AppParamsForCreatePublishJob) (int64, error)
CreatePublishJob ..
func (*PipelineManager) CreateTaskTmpl ¶
func (pm *PipelineManager) CreateTaskTmpl(request *TaskTmplReq, creator string) error
CreateTaskTmpl ..
func (*PipelineManager) DeleteTaskTmpl ¶
func (pm *PipelineManager) DeleteTaskTmpl(stepID int64) error
DeleteTaskTmpl ..
func (*PipelineManager) GetCIConfig ¶
func (pm *PipelineManager) GetCIConfig(stageID int64) ([]string, error)
GetCIConfig ..
func (*PipelineManager) GetFirstStepByPipelineInstanceIDAndStageID ¶
func (pm *PipelineManager) GetFirstStepByPipelineInstanceIDAndStageID(instanceID, stageID int64) (string, string, error)
GetFirstStepByPipelineInstanceIDAndStageID ..
func (*PipelineManager) GetFlowComponents ¶
func (pm *PipelineManager) GetFlowComponents() ([]*models.FlowComponent, error)
GetFlowComponents ..
func (*PipelineManager) GetJenkinsConfig ¶
func (pm *PipelineManager) GetJenkinsConfig(stageID int64) (*JenkinsConfigRsp, error)
GetJenkinsConfig ..
func (*PipelineManager) GetNextStepType ¶
GetNextStepType ..
func (*PipelineManager) GetNextStepTypeByStageID ¶
func (pm *PipelineManager) GetNextStepTypeByStageID(instanceID, stageID int64, stepIndex int) (string, error)
GetNextStepTypeByStageID ..
func (*PipelineManager) GetPipelineInstanceEnvStageByID ¶
func (pm *PipelineManager) GetPipelineInstanceEnvStageByID(pipelineInstanceID, stageID int64) (*PipelineStageStruct, error)
GetPipelineInstanceEnvStageByID ..
func (*PipelineManager) GetPipelineInstanceJSONByID ¶
func (pm *PipelineManager) GetPipelineInstanceJSONByID(pipelineInstanceID int64) (PipelineConfig, error)
GetPipelineInstanceJSONByID ..
func (*PipelineManager) GetPublishStats ¶
func (pm *PipelineManager) GetPublishStats(projectID int64, request *PublishStatsReq) ([]*PublishStatsRsp, error)
GetPublishStats ..
func (*PipelineManager) GetStepInfo ¶
func (pm *PipelineManager) GetStepInfo(projectID int64, publishID int64, stageID int64, stepName string) (interface{}, error)
GetStepInfo ...
func (*PipelineManager) GetTaskTmplByName ¶
func (pm *PipelineManager) GetTaskTmplByName(name string) (*models.TaskTmpl, error)
GetTaskTmpls ..
func (*PipelineManager) GetTaskTmpls ¶
func (pm *PipelineManager) GetTaskTmpls() ([]TaskTmplResp, error)
GetTaskTmpls ..
func (*PipelineManager) GetTaskTmplsByPagination ¶
func (pm *PipelineManager) GetTaskTmplsByPagination(filter *query.FilterQuery) (*query.QueryResult, error)
GetTaskTmplsByPagination ..
func (*PipelineManager) RunBuildDeployCallBackStep ¶
func (pm *PipelineManager) RunBuildDeployCallBackStep(request *BuildStepCallbackReq) (int64, error)
RunBuildDeployCallBackStep publish-order build callback operation
func (*PipelineManager) RunBuildStep ¶
func (pm *PipelineManager) RunBuildStep(projectID, publishID, stageID int64, creator, stepName string, params *BuildStepReq) (int64, int64, string, error)
RunBuildStep publish-order build operation
func (*PipelineManager) RunDeployStep ¶
func (pm *PipelineManager) RunDeployStep(projectID, publishID, stageID int64, creator, stepName string, params *DeployStepReq) (int64, int64, string, error)
RunDeployStep publish-order deploy operation
func (*PipelineManager) RunManualStep ¶
func (pm *PipelineManager) RunManualStep(publishID, stageID int64, request *ManualStepReq) (int64, error)
RunManualStep .. return publish status, error
func (*PipelineManager) UpdatePublishJob ¶
func (pm *PipelineManager) UpdatePublishJob(publishJobID, runID int64) error
UpdatePublishJob update job runID into publishjob item
func (*PipelineManager) UpdatePublishJobStatus ¶
func (pm *PipelineManager) UpdatePublishJobStatus(publishJobID int64, status string) error
UpdatePublishJobStatus ..
func (*PipelineManager) UpdateTaskTmpl ¶
func (pm *PipelineManager) UpdateTaskTmpl(request *TaskTmplReq, stepID int64) error
UpdateTaskTmpl ..
type PipelineSetupReq ¶
type PipelineSetupReq struct { PipelineBaseReq Configs []*PipelineStageStruct `json:"configs"` }
PipelineSetupReq ..
type PipelineStageStruct ¶
type PipelineStageStruct struct { StageID int64 `json:"stage_id"` PipelineID int64 `json:"pipeline_id"` Index int64 `json:"index"` ID int64 `json:"id"` Steps PipelineSteps `json:"steps"` Name string `json:"name,omitempty"` // instance part PipelineInstanceID int64 `json:"pipeline_instance_id,omitempty"` }
PipelineStageStruct ..
func (*PipelineStageStruct) String ¶
func (p *PipelineStageStruct) String() (string, error)
String ...
type PipelineSteps ¶
type PipelineSteps []*struct { Name string `json:"name"` Type string `json:"type"` TypeDisplay string `json:"type_display,omitempty"` StepID int64 `json:"step_id"` Index int `json:"index"` Driver string `json:"driver"` SubTask []*subTask `json:"sub_task"` }
PipelineSteps ..
func (PipelineSteps) Struct ¶
func (p PipelineSteps) Struct(sc string) (PipelineSteps, error)
Struct ...
type ProjectWhiteIDs ¶
type ProjectWhiteIDs []int64
ProjectWhiteIDs ..
func (ProjectWhiteIDs) Struct ¶
func (p ProjectWhiteIDs) Struct(ws string) (ProjectWhiteIDs, error)
Struct ...
type PublishApplyStepReq ¶
type PublishApplyStepReq struct { Approver string `json:"approver"` Message string `json:"message"` }
PublishApplyStepReq publish apply request
type PublishAuditStepReq ¶
type PublishAuditStepReq struct { BaseStepReq Message string `json:"message"` }
PublishAuditStepReq ..
type PublishJobAppRsp ¶
type PublishJobAppRsp struct { *models.PublishJobApp AppName string `json:"app_name"` }
PublishJobAppRsp ..
type PublishJobBuildResult ¶
type PublishJobBuildResult struct { AppID string `json:"app_id"` ImageVersion string `json:"image_version"` OriginRevision string `json:"origin_revision"` CurrentRevision string `json:"current_revision"` Release string `json:"release"` }
PublishJobBuildResult ..
type PublishJobRsp ¶
type PublishJobRsp struct { *models.PublishJob Apps []*PublishJobAppRsp `json:"apps"` }
PublishJobRsp ..
type PublishSetupReq ¶
type PublishSetupReq struct { Announcement string `json:"announcement"` DateEnabled bool `json:"date_enable"` DenyEndTime string `json:"deny_end_time"` DenyStartTime string `json:"deny_start_time"` DenyEnvList DenyEnvList `json:"deny_env_list"` WeeklyDenyList WeeklyDenyList `json:"pre_week_deny_list"` ProjectWhiteIDs ProjectWhiteIDs `json:"project_white_ids"` }
PublishSetupReq ..
type PublishStatsReq ¶
type PublishStatsReq struct { AppIDs []int64 `json:"app_ids"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` EnvIDs []int64 `json:"env_ids"` }
PublishStatsReq ..
type PublishStatsRsp ¶
type PublishStatsRsp struct { Time string `json:"time"` BuildSuccess int64 `json:"build_success"` BuildFailed int64 `json:"build_failed"` DeploySuccess int64 `json:"deploy_success"` DeployFailed int64 `json:"deploy_failed"` TotalSuccess int64 `json:"total_success"` TotalFailed int64 `json:"total_failed"` }
PublishStatsRsp ..
type PublishStepReq ¶
type PublishStepReq struct { ActionName string `json:"action_name"` Apps []*RunPublishAppReq `json:"apps"` EnableSwitchBranch bool `json:"enable_switch_branch"` }
PublishStepReq pipeline run publish
type PublishStepResp ¶
type PublishStepResp struct { TargetBranch []string `json:"target_branch,omitempty"` AppName string `json:"app_name,omitempty"` Type string `json:"type,omitempty"` ProjectAppID int64 `json:"project_app_id,omitempty"` Language string `json:"language,omitempty"` BranchName string `json:"branch_name,omitempty"` BuildPath string `json:"build_path,omitempty"` CompileCommand string `json:"compile_command,omitempty"` BranchHistoryList []string `json:"branch_history_list,omitempty"` }
PublishStepResp ...
type RunBuildAllParms ¶
type RunBuildAllParms struct { *RunBuildAppReq *models.ScmApp Release string `json:"release"` MergeBranch bool `json:"merge-branch"` ProjectID int64 }
RunBuildAllParms there are all apps parms for jenkins pipeline job
type RunBuildAppReq ¶
type RunBuildAppReq struct { Branch string `json:"branch_name"` CompileCommand string `json:"compile_command"` ProjectAppID int64 `json:"project_app_id"` }
RunBuildAppReq .
type RunDeployAllParms ¶
type RunDeployAllParms struct { *models.ScmApp *RunDeployAppReq ImageAddr string `json:"image_addr"` ProjectID int64 }
RunDeployAllParms there are all apps parms for jenkins pipeline job
type RunDeployAppReq ¶
RunDeployAppReq .
type RunPublishAllParms ¶
type RunPublishAllParms struct { *models.ProjectApp *RunPublishAppReq Release string `json:"release"` MergeBranch bool `json:"merge-branch"` }
RunPublishAllParms there are all apps parms for jenkins pipeline job
type RunPublishAppReq ¶
type RunPublishAppReq struct { AutoMerge bool `json:"auto_merge"` Branch string `json:"branch_name"` Gray bool `json:"gray"` ImageVersion string `json:"image_version"` Jacoco bool `json:"jacoco"` ProjectAppID int64 `json:"project_app_id"` StaticCheck bool `json:"static_check"` TargetBranch string `json:"target_branch"` UnitTest bool `json:"unit_test"` }
RunPublishAppReq .
type StepRsp ¶
type StepRsp struct { Name string `json:"name,omitempty"` Creator string `json:"creator,omitempty"` Message string `json:"message,omitempty"` }
StepRsp .. manual step defined
type StepTemplate ¶
type StepTemplate []*struct { Index int `json:"index"` Enable bool `json:"enable"` Role []string `json:"role"` Name string `json:"name"` SystemCode string `json:"system_code"` TargetBranch []string `json:"target_branch,omitempty"` }
StepTemplate ...
func (StepTemplate) Struct ¶
func (p StepTemplate) Struct(sc string) (StepTemplate, error)
Struct ...
type TaskTmplReq ¶
type TaskTmplReq struct { Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` SubTask []SubTask `json:"sub_task"` }
TaskTmplReq create step
type TaskTmplResp ¶
type TaskTmplResp struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Description string `json:"description,omitempty"` SubTask []subTask `json:"sub_task,omitempty"` ID int64 `json:"id,omitempty"` ComponentID int64 `json:"component_id,omitempty"` CreateAt time.Time `json:"create_at,omitempty"` UpdateAt time.Time `json:"update_at,omitempty"` Creator string `json:"creator,omitempty"` TypeDisplay string `json:"type_display,omitempty"` }
TaskTmplResp ..
type WeeklyDenyList ¶
type WeeklyDenyList []*struct { StartTime string `json:"start_time"` Enable bool `json:"enable"` Name string `json:"name"` EndTime string `json:"end_time"` }
WeeklyDenyList ..
func (WeeklyDenyList) Struct ¶
func (w WeeklyDenyList) Struct(ws string) (WeeklyDenyList, error)
Struct ...